diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-08-12 21:19:41 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-08-12 21:19:41 +0400 |
commit | 6d81e8f582ef4c79c8ccb23970c0da66281254d8 (patch) | |
tree | aa017d759db6181656adc5f2100e4f26940e02de /tests | |
parent | 55a1f2d9d3e97bad8ef702baee6606b665a12a41 (diff) |
Only auto-update .travis.yml file if we are latest commit in branch.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/travis/autoupdate_travis_yml.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/travis/autoupdate_travis_yml.sh b/tests/travis/autoupdate_travis_yml.sh index 20f51f7d9b..6fffd73886 100755 --- a/tests/travis/autoupdate_travis_yml.sh +++ b/tests/travis/autoupdate_travis_yml.sh @@ -37,11 +37,14 @@ if [ "$DIFF_RESULT" -eq "1" ]; then if [ "$LAST_COMMIT_MESSAGE" == "" ] || [ "$LAST_COMMIT_IS_NOT_UPDATE" -eq "0" ]; then echo "Last commit message was '$LAST_COMMIT_MESSAGE', possible recursion or error in auto-update, aborting." else - # only run auto-update for first travis job and if not a pull request - if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [[ "$TRAVIS_JOB_NUMBER" == *.1 ]]; then + LATEST_COMMIT_HASH=`git rev-parse $TRAVIS_BRANCH` + CURRENT_COMMIT_HASH=`git rev-parse HEAD` + + # only run auto-update for first travis job, if not a pull request and if we are latest commit + if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [[ "$TRAVIS_JOB_NUMBER" == *.1 ]] && [ "$LATEST_COMMIT_HASH" == "$CURRENT_COMMIT_HASH" ]; then $PIWIK_ROOT_DIR/tests/travis/configure_git.sh # re-configure in case git hasn't been configured yet - git status + git checkout $TRAVIS_BRANCH git add .travis.yml git commit -m ".travis.yml file is out of date, auto-updating .travis.yml file." |