Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Panciera
committed
Apr 13, 2016
1 parent
aa2d3c1
commit 72e81bf
Showing
8 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "builds@travis-ci.org" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters