Skip to content

Commit

Permalink
add travis_after_all to ensure that gem is only published if all buil…
Browse files Browse the repository at this point in the history
…ds succeed
  • Loading branch information
Daniel Dreier committed Jul 15, 2015
1 parent e226631 commit 1e24fb7
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,41 @@ rvm:
- 2.0.0
- 2.1.5
- 2.2.2
script:
- bundle exec rake ci
deploy:
provider: rubygems
api_key:
secure: "ivsiPBTcedPXuQ3hiLhLMDEaM5UUWfNi32Wy/BaDw8qwrUa6+v87IOFzipse4pa7GXzEpZf65o6/5ihxGeSZtw1sf90kwF2tMVWqjp4oFoHqg83Qscsz49X4yE1IkgVj1W/tOg2gJDneCjf250bZ3Wg/3UFSORM/f/3WVQ9vidHzb0JEaPWf4ClSeW7UVZfGz2muc6txKsQJwWgNccuyOnCfc9ElS4Vn130cIMB/t0xumVos2z8CExAFJ2dMfSqHJMc/NtamXT/tED6e2G28wLQGzViO48DuAyG3v+ubrEFpknaLkEzryfvOUPieP/hpCm9yfzbkTnulgFg1qw2QMtkrubECujZ3hg59UNyeKcixrihEWL6oSqCkJKbGyVnNxYpisb08Jdxq2o1xQD5uh1EGmMaewl3NExYdjCTzDmCVgEO7I5ItiKwUCMl9mVAGa2LEiI/SCjFxoEdglJOfCqeGunWXG1QjE2KYaD1qzkR4VCqBEP7v+wgheL0108VILjOQ6SzfMt6aaAjX0nQ2thtMvIeWUVXBlRUOzNVtQaGSyMcABPespDoyrlE5N/6HwVon+OObVKo+0mx9OYrRwxlBkAqp/vV2mXSdlD6ThUYgk7bk5ofpKQuJGTT/sr1Vyulzh2a2B1D2lDCK87mHbqvd5XnxuGCNFA90wxJ5biI="
on:
tags: true
condition: $SAFE_TO_DEPLOY = "true"
branch: master

# all this travis_after_all nonsense is a hack to ensure that travis only publishes to rubygems after *all* builds pass, not just the first one
script:
- curl -o travis_after_all.py https://raw.githubusercontent.com/dmakhno/travis_after_all/5acf1b8d164e7da313f72a8634bdd95182f890f5/travis_after_all.py
- bundle exec rake ci
after_success:
- python travis_after_all.py
- export $(cat .to_export_back)
- |
if [ "$BUILD_LEADER" = "YES" ]; then
if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then
echo "All Succeded! PUBLISHING..."
export SAFE_TO_DEPLOY = "true"
else
echo "Some Failed"
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 Failed"
else
echo "Some Failed"
fi
fi
after_script:
- echo leader=$BUILD_LEADER status=$BUILD_AGGREGATE_STATUS

0 comments on commit 1e24fb7

Please sign in to comment.