-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·62 lines (54 loc) · 1.71 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
53
54
55
56
57
58
59
60
61
62
sudo: required
language: python
python:
- "3.6"
stages:
- name: test
- name: deploy
if: tag IS present
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
- REPO=cassinyio/cassiny-spawner
- DB_USER=postgres
- DB_PASSWORD=mysecretpassword
- DB_PORT=15432
- STREAM_URI=nats://localhost:4222
services:
- docker
jobs:
include:
- stage: test
install:
- sudo apt-get update
- sudo apt-get install docker-ce
- docker run -d --name streams -p 4222:4222 nats-streaming:0.7.0
- docker run -d --name postgres -e POSTGRES_DB=$POSTGRES_DB -e POSTGRES_USER=$POSTGRES_USER -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -p $DB_PORT:5432 postgres:10.0
- docker swarm init
- docker network create --driver overlay --attachable cassiny-public
- sudo mkdir ./keys
- sudo chown -R $USER ./keys
- ssh-keygen -t rsa -b 4096 -f ./keys/private.key -N ''
- openssl rsa -in ./keys/private.key -pubout -outform PEM -out ./keys/public.key
- pip install -r requirements/ci.txt
- pip install -r requirements/common.txt
script:
- make lint
- make test
after_success:
- docker rm -f streams
- docker rm -f postgres
- docker swarm leave -f
- codecov
- stage: deploy
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- export TAG=$TRAVIS_BRANCH
- docker build -f Dockerfile -t $REPO:$TAG .
- docker push $REPO:$TAG
notifications:
webhooks:
urls:
- https://webhooks.cassiny.io
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always