forked from opentargets/genetics-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (50 loc) · 1.5 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
sudo: required
language: scala
scala:
- 2.12.10
dist: xenial
jdk:
- openjdk11
services:
- docker
env:
global:
- QUAY_REPO="quay.io/opentargets/genetics-api"
script:
- sbt ++${TRAVIS_SCALA_VERSION} scalafmtCheckAll
- sbt ++$TRAVIS_SCALA_VERSION clean compile
- sbt ++$TRAVIS_SCALA_VERSION coverage "testOnly * -- -l configuration.IntegrationTestTag" coverageReport
- sbt ++$TRAVIS_SCALA_VERSION dist
deploy:
provider: releases
api_key: ${GITHUB_KEY}
file_glob: true
file:
- "target/universal/ot-genetics-api-latest.zip"
on:
repo: opentargets/genetics-api
tags: true
skip_cleanup: true
notifications:
email:
recipients:
on_success: never
on_failure: always
after_success:
- bash <(curl -s https://codecov.io/bash)
- docker pull "${QUAY_REPO}:${TRAVIS_BRANCH}" || true
- docker build --pull --cache-from "${QUAY_REPO}:${TRAVIS_BRANCH}" --tag "${QUAY_REPO}" .
- docker login -u="${QUAY_USER}" -p="${QUAY_PASSWORD}" quay.io
- git_sha="${TRAVIS_COMMIT}"
- docker tag "${QUAY_REPO}" "${QUAY_REPO}:${TRAVIS_BRANCH}"
- docker tag "${QUAY_REPO}" "${QUAY_REPO}:${git_sha}-${TRAVIS_BRANCH}"
#only push non-PRs
- |
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
docker push "${QUAY_REPO}:${TRAVIS_BRANCH}" && docker push "${QUAY_REPO}:${git_sha}-${TRAVIS_BRANCH}"
if [ "${TRAVIS_BRANCH}" = "master" ]; then
docker tag "${QUAY_REPO}:${TRAVIS_BRANCH}" "${QUAY_REPO}:latest"
docker push "${QUAY_REPO}:latest"
fi
fi