-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (36 loc) · 1.02 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
dist: bionic
notifications:
email: false
services:
- docker
language: rust
before_install:
- rustup component add rustfmt
- cargo fmt --all -- --check
install:
- curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
before_script: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
heroku container:login
heroku container:pull --app=rfcbot-rs web
fi
script: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then heroku container:push --app=rfcbot-rs web; fi
docker-compose up -d
docker-compose exec web cargo test --release --locked
after_failure:
docker-compose logs web
before_cache:
# don't cache the cargo registry
- rm -rf "$HOME/.cargo/registry"
cache:
directories:
- "$HOME/.cargo"
before_deploy: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
docker-compose exec -e DATABASE_URL=$(heroku config:get DATABASE_URL --app=rfcbot-rs) web \
diesel migration run
fi
deploy:
provider: script
script: if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then heroku container:release --app=rfcbot-rs web; fi