Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cd2 #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Cd2 #111

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ install:
- ./install.sh miniconda
- export PATH=$PWD/miniconda/bin:$PATH
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then pip install robotframework-python3; else pip install robotframework; fi
before_script:
- 'echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"'
- 'echo "TRAVIS_TAG: $TRAVIS_TAG"'
- 'echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"'
- '.travis/master.sh'
- '.travis/develop.sh'
script:
- nosetests tests -v --with-coverage --cover-erase --cover-package=bio_bits -a '!download'
- pybot tests/*.robot
- cat /home/travis/build/VDBWRAIR/bio_bits/output.xml
after_success:
- coveralls
- .travis/push_release_tag.sh
notifications:
webhooks:
urls:
Expand Down
11 changes: 11 additions & 0 deletions .travis/current_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python
# just print current value of __version__ in __init__.py
import os
from os.path import join, basename, dirname

THIS = dirname(__file__)
TRAVIS_REPO_SLUG = os.environ['TRAVIS_REPO_SLUG']
project_name = basename(TRAVIS_REPO_SLUG)

execfile(join(THIS, '../', project_name, '__init__.py'))
print __version__
11 changes: 11 additions & 0 deletions .travis/develop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [ "${TRAVIS_BRANCH}" != "develop" ]
then
echo "Not develop branch. Skipping"
exit 0
fi

set -e

.travis/in_commit.sh CHANGELOG.rst docs/
15 changes: 15 additions & 0 deletions .travis/in_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Exit if not found
set -e

# Files that were modified in this commit
FILES_CHANGED=$(git diff --name-only HEAD~1)
echo "Files changed in current commit:"
echo ${FILES_CHANGED}

# Exit if files
for file in $@
do
echo ${FILES_CHANGED} | grep -q $file || ( echo "$file not in commit"; exit 1 )
done
12 changes: 12 additions & 0 deletions .travis/master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [ "${TRAVIS_BRANCH}" != "master" ]
then
echo "Not master branch. Skipping"
exit 0
fi

set -e

# Make sure changelog is updated
.travis/in_commit.sh CHANGELOG.rst
32 changes: 32 additions & 0 deletions .travis/push_release_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]
then
echo "This is a pull request. Skipping release process"
exit 0
fi

if [[ "${TRAVIS_BRANCH}" != "master" ]]
then
echo "Not master branch. Skipping release process"
exit 0
fi

if .travis/version_updated.sh >/dev/null 2>&1
then
echo "Version not updated. Skipping release process"
exit 0
fi

set -ev

git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
export GIT_TAG="v$(.travis/current_version.py)"
git tag $GIT_TAG -a -m "See [Changelog](CHANGELOG.rst) for all changes"
# Requires you first make a Personal Access tokens(https://github.com/settings/tokens)
# Then add GH_TOKEN to https://travis-ci.org/user/project/settings
export PROJECT=$(basename ${TRAVIS_REPO_SLUG})
set +v
echo "Pushing $GIT_TAG"
git push --quiet https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $GIT_TAG
4 changes: 4 additions & 0 deletions .travis/version_updated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Make sure version is changed
git diff $(basename $TRAVIS_REPO_SLUG)/__init__.py | grep -q '^.__version__' || (echo "Version was not updated"; exit 1)
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
CHANGELOG
=========

Version 1.4.0
-------------
* Switched to conda install
* Added continuous delivery

Version 1.3.2
-------------

Expand Down