Skip to content

Commit 20a8680

Browse files
committed
Trim generated .travis.yml by fetching install script dynmically.
Not sure of the wisdom of this - one one hand we can fix things in planemo as time goes on and that is good and may prove needed since we are targeting galaxy-central. On the other hand this is less tweakable and may in fact be more likely to break - hard to say. Example of workin generated .travis.yml file here jmchilton/bwa-mem@c7a5133.
1 parent 6a9a80a commit 20a8680

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

planemo/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
# -*- coding: utf-8 -*-
22

33
__version__ = '0.0.1'
4+
5+
6+
PROJECT_NAME = "planemo"
7+
PROJECT_USERAME = "jmchilton"
8+
RAW_CONTENT_URL = "https://raw.github.com/%s/%s/master/" % (
9+
PROJECT_USERAME, PROJECT_NAME
10+
)

planemo/commands/cmd_travis_init.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from planemo.cli import pass_context
66
from planemo.io import warn, info
77
from planemo import options
8+
from planemo import RAW_CONTENT_URL
89
from galaxy.tools.deps.commands import shell
910

1011
PREPARE_MESSAGE = (
@@ -15,6 +16,7 @@
1516
"tool project with Travi CI by visiting https://travis-ci.org/."
1617
)
1718

19+
TRAVIS_TEST_SCRIPT_URL = RAW_CONTENT_URL + "scripts/travis_test.sh"
1820
TRAVIS_YML = """
1921
# This is a special configuration file to run tests on Travis-CI via
2022
# GitHub notifications when changes are committed.
@@ -29,17 +31,9 @@
2931
# (which will still have a system python installed).
3032
language: java
3133
32-
install:
33-
- sudo apt-get install -y python-virtualenv
34-
- virtualenv planemo-venv
35-
- . planemo-venv/bin/activate
36-
- pip install git+https://github.com/jmchilton/planemo.git
37-
- planemo travis_before_install
38-
- . ${TRAVIS_BUILD_DIR}/.travis/env.sh # source enviornment created by planemo
39-
4034
script:
41-
- planemo test --install_galaxy ${TRAVIS_BUILD_DIR}
42-
"""
35+
- wget -O- %s | /bin/bash -x
36+
""" % TRAVIS_TEST_SCRIPT_URL
4337

4438

4539
@click.command('travis_init')
@@ -59,6 +53,9 @@ def cli(ctx, path):
5953
These tests were inspired by work original done and documented by Peter
6054
Cock here http://bit.ly/gxtravisci.
6155
"""
56+
# TODO: Option --verbose_travis_yaml to unroll travis_test.sh line by line
57+
# and place all but last in 'install' section and last in 'script'. Would
58+
# require a yaml dependency though.
6259
shell("mkdir -p '%s/.travis'" % path)
6360
travis_yml = os.path.join(path, ".travis.yml")
6461
setup_sh = os.path.join(path, ".travis", "setup_custom_dependencies.bash")

scripts/travis_test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
sudo apt-get install -y python-virtualenv
3+
virtualenv planemo-venv
4+
. planemo-venv/bin/activate
5+
pip install git+https://github.com/jmchilton/planemo.git
6+
planemo travis_before_install
7+
. ${TRAVIS_BUILD_DIR}/.travis/env.sh # source enviornment created by planemo
8+
planemo test --install_galaxy ${TRAVIS_BUILD_DIR}

0 commit comments

Comments
 (0)