-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
30 lines (30 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
os: linux
language: scala
scala:
- 2.13.1
jdk: openjdk8
services: docker
before_cache:
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete
cache:
directories:
- $HOME/.cache/coursier
- $HOME/.ivy2/cache
- $HOME/.sbt
script:
- sbt ++$TRAVIS_SCALA_VERSION scalafmtCheck scalafmtSbtCheck test:scalafmtCheck clean coverage test
after_success:
- sbt coverageReport coveralls
before_deploy:
- sbt docker:publishLocal
- echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Note: On tag builds $TRAVIS_BRANCH contains tag name, not branch name
- docker tag "open360/api" "$DOCKER_REPOSITORY:$([ "$TRAVIS_BRANCH" == "master" ] && echo "latest" || echo "$TRAVIS_BRANCH")"
deploy:
provider: script
script: docker push "$DOCKER_REPOSITORY:$([ "$TRAVIS_BRANCH" == "master" ] && echo "latest" || echo "$TRAVIS_BRANCH")"
on:
all_branches: true
condition: $TRAVIS_PULL_REQUEST = false