forked from kecsou/devops-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (35 loc) · 1.25 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
language: python
sudo: required
python:
- "3.6"
services:
- docker
before_install:
- curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x kubectl && sudo mv kubectl /usr/local/bin/kubectl
# command to install dependencies
install:
- pip install -r requirements.txt
# command to run tests
script:
- cd src
- pytest -q tests.py
- cd ..
after_success:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $DISCORD_WEBHOOK
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t "$DOCKER_USERNAME"/devops-project:$TRAVIS_BUILD_NUMBER -t "$DOCKER_USERNAME"/devops-project:latest .
- docker push "$DOCKER_USERNAME"/devops-project:$TRAVIS_BUILD_NUMBER
- docker push "$DOCKER_USERNAME"/devops-project:latest
- bash scripts/updateKube.sh
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $DISCORD_WEBHOOK
deploy:
provider: script
script: bash scripts/deploy.sh
on:
branch: master