Permalink
Browse files

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.
  • Loading branch information...
jmchilton committed Oct 8, 2014
1 parent 6a9a80a commit 20a86807cb7ea87db2dbc0197ae08a40df3ab2bc
Showing with 22 additions and 10 deletions.
  1. +7 −0 planemo/__init__.py
  2. +7 −10 planemo/commands/cmd_travis_init.py
  3. +8 −0 scripts/travis_test.sh
@@ -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
)
@@ -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")
@@ -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}

0 comments on commit 20a8680

Please sign in to comment.