Create Dist ; bionic

This commit is contained in:
fr33zespace 2023-03-22 07:13:32 -05:00 committed by GitHub
parent 24cb908017
commit ac3bac6f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

71
Dist ; bionic Normal file
View File

@ -0,0 +1,71 @@
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