Skip to content

Commit dec9662

Browse files
committed
.travis.yml: don't do deploy on pull requests to the prod branch.
Quote from http://eng.localytics.com/best-practices-and-common-mistakes-with-travis-ci/ "The most easily abused is $TRAVIS_BRANCH, particularly if you’re determining whether or not to deploy. Be cautious though - when Travis is building a pull request, $TRAVIS_BRANCH will be set to the target as opposed to the origin." No functional changes. [ci skip]
1 parent 3820e8f commit dec9662

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ before_script:
1212
- if [ "$SPRING_PROFILES_ACTIVE" = 'travis' ]; then
1313
mysql -u travis -e 'CREATE DATABASE mystamps CHARACTER SET utf8;';
1414
mkdir -p /tmp/uploads /tmp/preview;
15-
if [ "$TRAVIS_BRANCH" = 'prod' ]; then
15+
if [ "$TRAVIS_BRANCH" = 'prod' -a "$TRAVIS_PULL_REQUEST" = 'false' ]; then
1616
pip install --user ansible==2.1.1.0;
1717
fi;
1818
npm install -g bootlint;
@@ -41,7 +41,7 @@ deploy:
4141
script: ./src/main/scripts/ci/deploy.sh
4242
on:
4343
branch: prod
44-
condition: $SPRING_PROFILES_ACTIVE = 'travis'
44+
condition: "$SPRING_PROFILES_ACTIVE" = 'travis' -a "$TRAVIS_PULL_REQUEST" = 'false'
4545
skip_cleanup: true
4646

4747
jdk:

0 commit comments

Comments
 (0)