-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
29 lines (24 loc) · 942 Bytes
/
.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
dist: jammy
addons:
apt:
sources:
- sourceline: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable'
key_url: 'https://download.docker.com/linux/ubuntu/gpg'
services:
- docker
env:
global:
- QUAY_REPO="quay.io/opentargets/ot-ai-api"
- LOCAL_IMAGE_NAME="ot-ai-api"
before_install:
- docker version
- docker-compose version
script:
- docker build . -t "${LOCAL_IMAGE_NAME}"
after_success:
- set -ev
- docker login -u="$QUAY_USER" -p="$QUAY_PASSWORD" quay.io
- docker tag "${LOCAL_IMAGE_NAME}" "${QUAY_REPO}:${TRAVIS_COMMIT}"
- docker push "${QUAY_REPO}:${TRAVIS_COMMIT}"
- if [ "${TRAVIS_TAG}" != "" ]; then docker tag "${LOCAL_IMAGE_NAME}" "${QUAY_REPO}:${TRAVIS_TAG}"; docker push "${QUAY_REPO}:${TRAVIS_TAG}"; fi
- if [ "${TRAVIS_BRANCH}" == "main" ]; then docker tag "${LOCAL_IMAGE_NAME}" "${QUAY_REPO}:latest"; docker push "${QUAY_REPO}:latest"; fi