This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.travis.yml
47 lines (47 loc) · 1.64 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
sudo: required
dist: bionic # required for Python >= 3.7
language: python
services:
- docker
env:
global:
- ELASTICSEARCH_NODES="http://localhost:9200"
- QUAY_REPO="quay.io/opentargets/mrtarget"
python:
- 3.7
before_install:
- docker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.1
- docker run -d -p 9200:9200 -p 9300:9300 --name=es elasticsearch:7.6.1
install:
- pip install -r requirements.txt
- pip install -r requirements.dev.txt
- pip install -e .
- pipdeptree
script:
- mkdir log
- export DATA_CONFIG="https://storage.googleapis.com/open-targets-data-releases/20.04/input/mrtarget.data.20.04.yml" && make help dry_run
- pytest --cov=mrtarget --cov-report term tests/ --fulltrace
notifications:
email:
recipients:
on_success: never
on_failure: always
after_success:
- codecov
- docker pull "${QUAY_REPO}:${TRAVIS_BRANCH}" || true
#pull the previous built image to use as a cache if possible
- 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