Skip to content

Commit f3897f9

Browse files
committed
Do not use Heroku CLI on pull requests
1 parent 11915c7 commit f3897f9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.travis.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ before_install:
99
- cargo fmt --all -- --check
1010
install:
1111
- curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
12-
before_script:
13-
- heroku container:login
14-
- heroku container:pull --app=rfcbot-rs web
12+
before_script: |
13+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
14+
heroku container:login
15+
heroku container:pull --app=rfcbot-rs web
16+
fi
1517
script: |
16-
heroku container:push --app=rfcbot-rs web
18+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then heroku container:push --app=rfcbot-rs web; fi
1719
docker-compose up -d
1820
docker-compose exec web cargo test --release --locked
1921
after_failure:
@@ -25,8 +27,10 @@ cache:
2527
directories:
2628
- "$HOME/.cargo"
2729
before_deploy: |
30+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
2831
docker-compose exec -e DATABASE_URL=$(heroku config:get DATABASE_URL --app=rfcbot-rs) web \
2932
diesel migration run
33+
fi
3034
deploy:
3135
provider: script
32-
script: heroku container:release --app=rfcbot-rs web
36+
script: if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then heroku container:release --app=rfcbot-rs web; fi

0 commit comments

Comments
 (0)