This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (50 loc) · 1.66 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
sudo: required
language: python
services:
- docker
env:
global:
- QUAY_REPO="quay.io/opentargets/checkomatic"
python:
- '2.7'
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then sudo apt-get install python-pandas; fi
- pip install --upgrade pip
- pip install -r requirements.txt
script:
# - pytest --cov=opentargets --cov-report term tests/ --fulltrace
- pip install wheel
- python setup.py bdist_wheel --universal
notifications:
email:
recipients:
- ops@opentargets.org
on_success: never
on_failure: always
after_success:
- 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="$(git rev-parse --short HEAD)" # removed since travis provides a better one to use
- 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}"
#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
deploy:
provider: pypi
user: "${PYPI_USERNAME}"
password: "${PYPI_PASSWORD}"
skip_existing: true
skip_cleanup: true
distributions: "bdist_wheel"
on:
tags: true