From 832c42da74e6067578e603e3bbbde1b96cf00118 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 10:16:20 +0200 Subject: [PATCH 1/7] After success, trigger a build at hugovk/pillow-wheels/latest --- .travis.yml | 7 +++++++ build_children.sh | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100755 build_children.sh diff --git a/.travis.yml b/.travis.yml index 0b6263480..670feb158 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,6 +62,8 @@ after_success: - pyflakes PIL/*.py | tee >(wc -l) - pyflakes Tests/*.py | tee >(wc -l) + # Trigger an OS X build at the pillow-wheels repo + - ./build_children.sh # Coverage and quality reports on just the latest diff. # (Installation is very slow on Py3, so just do it for Py2.) @@ -69,3 +71,8 @@ after_success: - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-run.sh; fi matrix: fast_finish: true + +env: + global: + # travis encrypt AUTH_TOKEN= + secure: yC1RcYF932ICXcw8hR3MHKfw9G9030+w8SgGXhhH2htgsCvKrGtb7kA4pqN7eGS31QsGatj6NmYVOdut3jIqbtP+5Pd3xceGoeo3HMWfS5RPmgbrGmiVYeDH9ZZDDZMH85oRnMU/vfI3T8SdYdyYM3hXAPzXeU6jWxQA48ft4D4= diff --git a/build_children.sh b/build_children.sh new file mode 100755 index 000000000..ed8e15415 --- /dev/null +++ b/build_children.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Get last child project build number +BUILD_NUM=$(curl -s 'https://api.travis-ci.org/repos/hugovk/pillow-wheels/branches/latest' | grep -o '^{"branch":{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n') +# Restart last child project build +curl -X POST https://api.travis-ci.org/builds/$BUILD_NUM/restart --header "Authorization: token "$AUTH_TOKEN From 76f8a26c4783431e4f3542e2ad6df9afbecf3b0f Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 10:47:35 +0200 Subject: [PATCH 2/7] Use travis_after_all to ensure OS X build only triggered after all Linux jobs pass --- .travis.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 670feb158..52242682a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ install: - pushd depends && ./install_openjpeg.sh && popd script: + - curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py - coverage erase - python setup.py clean - CFLAGS="-coverage" python setup.py build_ext --inplace @@ -62,13 +63,40 @@ after_success: - pyflakes PIL/*.py | tee >(wc -l) - pyflakes Tests/*.py | tee >(wc -l) - # Trigger an OS X build at the pillow-wheels repo - - ./build_children.sh + # after_all + - python travis_after_all.py + - export $(cat .to_export_back) + - | + if [ "$BUILD_LEADER" = "YES" ]; then + if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then + echo "All jobs succeded! Triggering OS X build..." + # Trigger an OS X build at the pillow-wheels repo + ./build_children.sh + else + echo "Some jobs failed" + fi + fi # Coverage and quality reports on just the latest diff. # (Installation is very slow on Py3, so just do it for Py2.) - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-install.sh; fi - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-run.sh; fi + +after_failure: + - python travis_after_all.py + - export $(cat .to_export_back) + - | + if [ "$BUILD_LEADER" = "YES" ]; then + if [ "$BUILD_AGGREGATE_STATUS" = "others_failed" ]; then + echo "All jobs failed" + else + echo "Some jobs failed" + fi + fi + +after_script: + - echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS + matrix: fast_finish: true From ba743398996bbdb1c320efca318cb53f7af98c97 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 11:12:36 +0200 Subject: [PATCH 3/7] Move after_all to end of after_success --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52242682a..16241dd30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,6 @@ after_success: - travis_retry pip install coveralls-merge - coveralls-merge coverage.c.json - - travis_retry pip install pep8 pyflakes - pep8 --statistics --count PIL/*.py - pep8 --statistics --count Tests/*.py @@ -63,6 +62,11 @@ after_success: - pyflakes PIL/*.py | tee >(wc -l) - pyflakes Tests/*.py | tee >(wc -l) + # Coverage and quality reports on just the latest diff. + # (Installation is very slow on Py3, so just do it for Py2.) + - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-install.sh; fi + - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-run.sh; fi + # after_all - python travis_after_all.py - export $(cat .to_export_back) @@ -77,11 +81,6 @@ after_success: fi fi - # Coverage and quality reports on just the latest diff. - # (Installation is very slow on Py3, so just do it for Py2.) - - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-install.sh; fi - - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-run.sh; fi - after_failure: - python travis_after_all.py - export $(cat .to_export_back) From b65ca089e53b449eed77da754ccd02675fe25049 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 11:29:02 +0200 Subject: [PATCH 4/7] Only do travis_after_all for hugovk/Pillow/master --- .travis.yml | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16241dd30..c54a7773a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,6 @@ install: - pushd depends && ./install_openjpeg.sh && popd script: - - curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py - coverage erase - python setup.py clean - CFLAGS="-coverage" python setup.py build_ext --inplace @@ -68,33 +67,42 @@ after_success: - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then Scripts/diffcover-run.sh; fi # after_all - - python travis_after_all.py - - export $(cat .to_export_back) - | - if [ "$BUILD_LEADER" = "YES" ]; then - if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then - echo "All jobs succeded! Triggering OS X build..." - # Trigger an OS X build at the pillow-wheels repo - ./build_children.sh - else - echo "Some jobs failed" + if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py + python travis_after_all.py + export $(cat .to_export_back) + if [ "$BUILD_LEADER" = "YES" ]; then + if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then + echo "All jobs succeded! Triggering OS X build..." + # Trigger an OS X build at the pillow-wheels repo + ./build_children.sh + else + echo "Some jobs failed" + fi fi fi after_failure: - - python travis_after_all.py - - export $(cat .to_export_back) - | - if [ "$BUILD_LEADER" = "YES" ]; then - if [ "$BUILD_AGGREGATE_STATUS" = "others_failed" ]; then - echo "All jobs failed" - else - echo "Some jobs failed" + if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py + python travis_after_all.py + export $(cat .to_export_back) + if [ "$BUILD_LEADER" = "YES" ]; then + if [ "$BUILD_AGGREGATE_STATUS" = "others_failed" ]; then + echo "All jobs failed" + else + echo "Some jobs failed" + fi fi fi after_script: - - echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS + - | + if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS + fi matrix: fast_finish: true From b23b3f301561caa9b10614e7a68ad5a178998fe6 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 11:55:06 +0200 Subject: [PATCH 5/7] hugovk -> python-pillow --- .travis.yml | 6 +++--- build_children.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c54a7773a..3e7f55b1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ after_success: # after_all - | - if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py python travis_after_all.py export $(cat .to_export_back) @@ -85,7 +85,7 @@ after_success: after_failure: - | - if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py python travis_after_all.py export $(cat .to_export_back) @@ -100,7 +100,7 @@ after_failure: after_script: - | - if [ "$TRAVIS_REPO_SLUG" = "hugovk/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS fi diff --git a/build_children.sh b/build_children.sh index ed8e15415..f30118f48 100755 --- a/build_children.sh +++ b/build_children.sh @@ -1,6 +1,7 @@ #!/bin/bash -# Get last child project build number -BUILD_NUM=$(curl -s 'https://api.travis-ci.org/repos/hugovk/pillow-wheels/branches/latest' | grep -o '^{"branch":{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n') +# Get last child project build number from branch named "latest" +BUILD_NUM=$(curl -s 'https://api.travis-ci.org/repos/Pillow/pillow-wheels/branches/latest' | grep -o '^{"branch":{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n') + # Restart last child project build curl -X POST https://api.travis-ci.org/builds/$BUILD_NUM/restart --header "Authorization: token "$AUTH_TOKEN From 0cee278662befd2053ab9c823b5a1798342c39e3 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 18:47:03 +0200 Subject: [PATCH 6/7] TRAVIS_BRANCH=master also for PRs submitted to master, so also make sure TRAVIS_PULL_REQUEST=false --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e7f55b1c..13d8268a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ after_success: # after_all - | - if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py python travis_after_all.py export $(cat .to_export_back) @@ -85,7 +85,7 @@ after_success: after_failure: - | - if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then curl -Lo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py python travis_after_all.py export $(cat .to_export_back) @@ -100,7 +100,7 @@ after_failure: after_script: - | - if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS fi From 3330dbad67f03d0c66a05a9aa5362963d7250b4a Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 4 Jan 2015 20:19:56 +0200 Subject: [PATCH 7/7] Add missing ] --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 13d8268a5..b8b359ee0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,7 +100,7 @@ after_failure: after_script: - | - if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + if [ "$TRAVIS_REPO_SLUG" = "python-pillow/Pillow" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS fi