-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
46 lines (42 loc) · 1.63 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
---
language: python
python:
- "3.7"
services:
- docker
branches:
only:
- master
- release-.+
jobs:
include:
- stage: Test build on project; smoketest
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- sudo rm /usr/local/bin/docker-compose
- sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
script:
- docker-compose up -d --build
- docker-compose down
- stage: Deploy project to DockerHUB
if: type = push && branch = master
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t onibus-io-backend .
- docker tag onibus-io-backend $DOCKER_USERNAME/onibus-io-backend:$(cat VERSION)
- docker tag onibus-io-backend $DOCKER_USERNAME/onibus-io-backend:latest
script:
- docker push $DOCKER_USERNAME/onibus-io-backend:$(cat VERSION)
- docker push $DOCKER_USERNAME/onibus-io-backend:latest
- stage: Deploy to production server
if: type = push && branch = master
before_script:
- pip install pipenv
- openssl aes-256-cbc -K $encrypted_b0fc5fc1e8ae_key -iv $encrypted_b0fc5fc1e8ae_iv -in deploy/id_rsa.enc -out deploy/id_rsa -d
script:
- cd deploy
- ./run.sh
after_script:
- wget https://raw.githubusercontent.com/CodeForCuritiba/datascience-kit/master/telegram_publisher.sh
- bash ./telegram_publisher.sh