-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
52 lines (51 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
48
49
50
51
52
stages:
- test
- name: publish
if: branch = master AND type = push
- name: deploy
if: branch = master AND type = push
jobs:
include:
- stage: test
name: Python 3.7
install:
- pip install -r requirements.txt
- pip install -r requirements-e.txt
script:
- flake8 .
- mypy --ignore-missing-imports .
language: python
python: 3.7
dist: xenial
sudo: true
- stage: test
name: Python 3.6
install:
- pip install -r requirements.txt
- pip install -r requirements-e.txt
script:
- flake8 .
- mypy --ignore-missing-imports .
language: python
python: 3.6
dist: xenial
sudo: true
- stage: publish
script:
- echo $GCP_SERVICE_ACCOUNT | base64 --decode > keyfile.json
- cat keyfile.json | docker login -u _json_key --password-stdin https://gcr.io
- docker build -t gcr.io/$GCP_PROJECT_ID/apophis:$TRAVIS_COMMIT .
- docker tag gcr.io/$GCP_PROJECT_ID/apophis:$TRAVIS_COMMIT gcr.io/$GCP_PROJECT_ID/apophis:latest
- docker push gcr.io/$GCP_PROJECT_ID/apophis:$TRAVIS_COMMIT
- docker push gcr.io/$GCP_PROJECT_ID/apophis:latest
services:
- docker
- stage: deploy
install:
- sudo apt-get install -y apt-transport-https
- curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
- sudo apt-get update
- sudo apt-get install -y kubectl
script:
- ./deploy.sh