diff --git a/planemo/__init__.py b/planemo/__init__.py index ee9e26d52..5a86332e9 100644 --- a/planemo/__init__.py +++ b/planemo/__init__.py @@ -1,3 +1,10 @@ # -*- coding: utf-8 -*- __version__ = '0.0.1' + + +PROJECT_NAME = "planemo" +PROJECT_USERAME = "jmchilton" +RAW_CONTENT_URL = "https://raw.github.com/%s/%s/master/" % ( + PROJECT_USERAME, PROJECT_NAME +) diff --git a/planemo/commands/cmd_travis_init.py b/planemo/commands/cmd_travis_init.py index 492bbdbff..4e9d5fc20 100644 --- a/planemo/commands/cmd_travis_init.py +++ b/planemo/commands/cmd_travis_init.py @@ -5,6 +5,7 @@ from planemo.cli import pass_context from planemo.io import warn, info from planemo import options +from planemo import RAW_CONTENT_URL from galaxy.tools.deps.commands import shell PREPARE_MESSAGE = ( @@ -15,6 +16,7 @@ "tool project with Travi CI by visiting https://travis-ci.org/." ) +TRAVIS_TEST_SCRIPT_URL = RAW_CONTENT_URL + "scripts/travis_test.sh" TRAVIS_YML = """ # This is a special configuration file to run tests on Travis-CI via # GitHub notifications when changes are committed. @@ -29,17 +31,9 @@ # (which will still have a system python installed). language: java -install: - - sudo apt-get install -y python-virtualenv - - virtualenv planemo-venv - - . planemo-venv/bin/activate - - pip install git+https://github.com/jmchilton/planemo.git - - planemo travis_before_install - - . ${TRAVIS_BUILD_DIR}/.travis/env.sh # source enviornment created by planemo - script: - - planemo test --install_galaxy ${TRAVIS_BUILD_DIR} -""" + - wget -O- %s | /bin/bash -x +""" % TRAVIS_TEST_SCRIPT_URL @click.command('travis_init') @@ -59,6 +53,9 @@ def cli(ctx, path): These tests were inspired by work original done and documented by Peter Cock here http://bit.ly/gxtravisci. """ + # TODO: Option --verbose_travis_yaml to unroll travis_test.sh line by line + # and place all but last in 'install' section and last in 'script'. Would + # require a yaml dependency though. shell("mkdir -p '%s/.travis'" % path) travis_yml = os.path.join(path, ".travis.yml") setup_sh = os.path.join(path, ".travis", "setup_custom_dependencies.bash") diff --git a/scripts/travis_test.sh b/scripts/travis_test.sh new file mode 100644 index 000000000..026bd0543 --- /dev/null +++ b/scripts/travis_test.sh @@ -0,0 +1,8 @@ +#!/bin/sh +sudo apt-get install -y python-virtualenv +virtualenv planemo-venv +. planemo-venv/bin/activate +pip install git+https://github.com/jmchilton/planemo.git +planemo travis_before_install + . ${TRAVIS_BUILD_DIR}/.travis/env.sh # source enviornment created by planemo +planemo test --install_galaxy ${TRAVIS_BUILD_DIR}