Commit 47ee20ff authored by Alessandro Vullo's avatar Alessandro Vullo Committed by GitHub
Browse files

Merge pull request #17 from avullo/master

Master
parents be2b589f 839ef857
language: perl
perl:
- '5.14'
- '5.12'
- '5.10'
env:
matrix:
- COVERALLS=true DB=mysql
- COVERALLS=false DB=mysql
- COVERALLS=false DB=sqlite
global:
secure: IbEJR4ZkrgxYUJyQ0JxBY2NtBnJMvxKaRvVQaYutxLRW2qry3eFMJHjp3fFjmNRTK8vEobRODK2pAuXyTcYh/iThOwgXq4oS9cVBNc5/Vr5OsQgMqu/GHqDRW2WvTI0niSKZA5dq0yaDEShatwmEvLfz8berwN8QJM6XbVmT0FGwJBq9QG45t5hRbJVXsTgVGZad3nUjGhMoDD7iOkfApou40Tw6z2bFpItbTpmM8SOadOT26dPNaVA6Cn4+HO9kTXdFBOuq9/VoVe1s2ObsnVLf4jJqYcdHUg9L+VTp4xzfXIsvrzvPbAQm5Xj5JjjWqr43yEv6fOYQYtKdYhes1g3+wPrGTmcCjRm3SSp39RWpk9Po4o67kKmu1mG+gRSJwY5Xzj86TkO726cGhxK8v3Nra0h9rRAp+oeWJHAFVCYmeo5scZnrnEllLNc42pxsDXvcFS2nBwVcF5di82rSIT4RdgBN7C6wMBAzanUGibwJYuieBtJ5i4/TWu5wOQyohWv02OThs2YMsFry2gFVJKExbzmJMSYXos9AqjdP8iua/PFVTqNB4XeHQSYK3xxttYxASS0ZNb358OfnZhwx2Yvg1HNE7U0ShKkshw/KpoH132TP7C4usVSoxA28jnM0PvljRLRfWuBI62bsJr68b7X3m83eTZTaBKoge6l/f1w=
sudo: false
......@@ -18,25 +20,22 @@ addons:
- unzip
before_install:
- git clone --branch master --depth 1 https://github.com/Ensembl/ensembl.git
- git clone -b bioperl-release-1-6-1 --depth 1 https://github.com/bioperl/bioperl-live.git
install:
- cpanm -v --installdeps --notest .
- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n DBD::SQLite
- cp travisci/MultiTestDB.conf.travisci.mysql modules/t/MultiTestDB.conf.mysql
- cp travisci/MultiTestDB.conf.travisci.SQLite modules/t/MultiTestDB.conf.SQLite
- mysql -u root -h localhost -e 'GRANT ALL PRIVILEGES ON *.* TO "travis"@"%"'
- git clone --branch master --depth 1 https://github.com/Ensembl/ensembl.git
- git clone -b bioperl-release-1-6-1 --depth 1 https://github.com/bioperl/bioperl-live.git
install:
- cpanm -v --installdeps --notest .
- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n DBD::SQLite
- cp travisci/MultiTestDB.conf.travisci.mysql modules/t/MultiTestDB.conf.mysql
- cp travisci/MultiTestDB.conf.travisci.SQLite modules/t/MultiTestDB.conf.SQLite
- mysql -u root -h localhost -e 'GRANT ALL PRIVILEGES ON *.* TO "travis"@"%"'
script: "./travisci/harness.sh"
# Add build stage to trigger dependent builds, run sequentially after all test jobs
# specified by the build matrix expansion have completed successfully
jobs:
include:
- stage: trigger_dependent_builds
script: ./travisci/trigger-dependent-build.sh
- stage: trigger_dependent_builds
script: "./travisci/trigger-dependent-build.sh"
matrix:
exclude:
......@@ -50,7 +49,7 @@ matrix:
env: COVERALLS=false DB=sqlite
- perl: '5.14'
env: COVERALLS=true DB=mysql
notifications:
email:
on_success: always
......
......@@ -7,7 +7,7 @@ def api_build_run_last_hour(x):
return x['state'] != 'canceled' and \
x['event_type'] == 'api' and \
(x['finished_at'] == None or \
float((datetime.fromtimestamp(time.time()) - datetime.strptime(x['finished_at'],'%Y-%m-%dT%H:%M:%SZ')).seconds)/3600 < 1.0)
float((datetime.fromtimestamp(time.time()) - datetime.strptime(x['finished_at'],'%Y-%m-%dT%H:%M:%SZ')).total_seconds())/3600 < 1.0)
builds = list(filter(api_build_run_last_hour, json.load(sys.stdin)['builds']))
print(len(builds) > 0)
#!/bin/bash
# This script lives in each of the upstream repos. Add this to .travis.yml to
# run after each successful build (assuming that the script is in the root of
# the repo):
# after_success:
# - ./trigger-dependent-build
#
# There are three variables to set - `$auth_token`, `$endpoint`, and
# `$repo_id` - each is described below.
#
# An authorization token generated by running:
# gem install travis
# travis login
# travis token
#
####################
# Global Variables #
####################
# The authorisation token
auth_token=MdFujR8JsfCR9uJdw7jrPg
# The Travis API endpoint. .com and .org are the commercial and free versions,
# respectively; enterprise users will have their own hostname.
endpoint=https://api.travis-ci.org
......@@ -33,14 +14,14 @@ endpoint=https://api.travis-ci.org
# Get this repo ID
repo_id () {
curl -s -X GET -H "Authorization: token $auth_token" -H "Travis-API-Version: 3" https://api.travis-ci.org/repo/$1 | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"
curl -s -X GET -H "Authorization: token $AUTH_TOKEN" -H "Travis-API-Version: 3" https://api.travis-ci.org/repo/$1 | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"
}
# Make an API request using the auth token set above. First argument is the path
# of the API method, all later arguments are passed to curl directly.
travis_api () {
curl -s $endpoint$1 \
-H "Authorization: token $auth_token" \
-H "Authorization: token $AUTH_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Travis-API-Version: 3' \
"${@:2}"
......@@ -55,6 +36,7 @@ function env_var {
sed 's/{"env_var":{"id":"\([^"]*\)",.*/\1/'
}
# print a spinner and terminate it
sp="/-\|"
sc=0
spin() {
......@@ -101,17 +83,20 @@ for dep_repo in "${dep_repos[@]}"; do
# Wait until request is approved or max amount of time has passed
i=0
echo "Waiting for build request $dep_repo_master_build_request_id to be approved "
build_request_approved=""
until travis_api /repo/$dep_repo/request/$dep_repo_master_build_request_id | grep -q '"result": "approved"'; do
echo "Waiting for build request $dep_repo_master_build_request_id to be approved"
spin
sleep 5
true $(( i++ ))
if [ $i -eq 100 ]
then
echo "Request $dep_repo_master_build_request_id not approved, reached max waiting time ... ABORT"
echo " reached max waiting time ... ABORT"
exit 1
fi
done
endspin
echo "Build request approved."
# Get the ID of the master build.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment