This repository has been archived by the owner on May 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
54 lines (54 loc) · 1.86 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
51
52
53
54
sudo: required
language: python
services:
- docker
env:
global:
- QUAY_REPO="quay.io/opentargets/rest_api"
python:
- 2.7
install:
- pip install --upgrade pip
- pip install -r requirements.txt
script:
- pytest --cov=app --cov-report term tests/ --fulltrace
notifications:
email:
recipients:
on_success: never
on_failure: always
addons:
apt:
packages:
- gettext-base
- jq
after_success:
- codecov
- docker pull "${QUAY_REPO}:${TRAVIS_BRANCH}" || true
- docker build --pull --cache-from "${QUAY_REPO}:${TRAVIS_BRANCH}" --tag "${QUAY_REPO}" -f docker/Dockerfile .
- 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}"
- 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
# - |
# if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then
# rm -rf $HOME/google-cloud-sdk
# export CLOUDSDK_CORE_DISABLE_PROMPTS=1
# curl https://sdk.cloud.google.com | bash
# fi
# - source "$HOME/google-cloud-sdk/path.bash.inc"
# - gcloud config set disable_usage_reporting true
# - gcloud components install beta alpha docker-credential-gcr
# - echo $GCLOUD_KEY | base64 --decode > gcloud.p12
# - gcloud auth activate-service-account $GCLOUD_EMAIL --key-file gcloud.p12
# - ssh-keygen -f ~/.ssh/google_compute_engine -N ""
# # Push to Google container registry
# - docker build -t gcr.io/$CLOUDSDK_CORE_PROJECT/$CLOUDSDK_CORE_PROJECT:v1 .
# - gcloud docker push gcr.io/$CLOUDSDK_CORE_PROJECT/$CLOUDSDK_CORE_PROJECT:v1 > /dev/null