-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
75 lines (67 loc) · 6.79 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
63
64
65
66
67
68
69
70
71
72
73
74
75
language: python
python:
#- "3.6"
#- "3.7"
- "3.8"
services:
- docker
install:
- "pip install pipenv"
- "pipenv install --dev --skip-lock"
script:
- "make test"
#- "make lint"
- "make check-fmt"
notifications:
email: false
# env:
# global:
# secure: DOCKER_USER
# secure: DOCKER_PASSWORD
# secure: HEROKU_API_KEY
# secure: TELEGRAM_CHAT_ID
# secure: TELEGRAM_TOKEN
# replace the following env configurations with your own
env:
global:
- secure: EmRNXGrWtCC1bSusuOzJynDMX9WIZ2/R/UF5WPvtO4UE9KJtu+7VCD5hNN4omsFG81HHjEae+Mqf42JMBUYLu+vu/BqTOQFGW1PN40rwTXVXUys4J6QYyXm3bid7aDR6vc7n/UU77NjHJXYogh6+/JBoxE3rxYb0FT7jowZKtfNIdqQG3RActonSacGJLOgCtFjDAif3pY/fKOuuqW49NRfqIc85BW5lGCepcN/M5DqV2XDjeMkQgL1N9BaYkW+0xWgBH3zws19CtDqIGEsMU/4INfr896sGap3wSNGWmAEXI5CJ8x4/8T/dscx4XB/skedyjYKe+diBQVFyjovULXsWGRgzg0z6m0uojEm3qC8Po3F3GC9RoC0DS+IiSIyAArAG51lF1SPRLL4aQuRS0V12Rld1yvC84tXdFkOAk+0BfnsxQZNO9+nJWAqpdUGnlcWHvhezrKT5+NzpUXr7AKg7LcrMkLJPsXtgBrXMVABLzACEvPW8EiAkU9fqzR2fGWWvedIXyBef/RAcC6ddomjZdW802Yh2z9l8RZS4MWtUjmOUmtrb5J1CqY24Bxf9bMu3AB9jLT5eTmUiCkQY/euEMkkfPuPyBNHT8dIUuunibcbp75auzSdfumFG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UzIuyPFF2kbmz6oqIR0ItpfBARxoJPS6qHkhT1Zu+6JFRSJOtm3A8qHgytgR2GyW6yab34hk3KBnauEXNwMMYlKA+7lAKSKfX2aFSIXDlVSl85HoWAUHpfdn8RKPD9z7T2dvVTdOKCHNRf+Bta+hTCq1JxRiAMNbg3rPc3jPtgWqmEBX+giIIGjOU0c7HEjqBKhaVj7RenFpZv17BFfowUJ0v4EFcxxflxik=
# Create Docker image for our app and push it to Dockerhub repository and send messages to the Teams channel after the `script` job is successfully executed
after_success:
- coveralls
- export COMMIT=${TRAVIS_COMMIT::7}
- export TAG=`if [ ! -z "$TRAVIS_TAG" ]; then echo "$TRAVIS_TAG"; else echo "$TRAVIS_BRANCH--$COMMIT"; fi`
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- docker-compose build
- docker tag $IMAGE_NAME:latest $IMAGE_NAME:$TAG
- docker push $IMAGE_NAME:$TAG
- export TITLE="Docker image *$IMAGE_NAME:$TAG* is built properly and pushed to DockerHub."
- export TIMESTAMP=`date`
- export GIT_LOG=`git log -1 --pretty=%B $COMMIT`
- export TEXT="[build version] $TAG this $TIMESTAMP, with the last commit message *$GIT_LOG*."
#- chmod +x send_to_teams.sh && ./send_to_teams.sh
- bash ./telegram_notification.sh
# If the `script` job fails, it will send a failure message to Teams channel
after_failure:
- export TITLE="Travis:$TRAVIS_JOB_ID -- build job is failed"
- export TEXT=`date`, go to travis dashbord to check log file for more details !
- bash ./telegram_notification.sh
# Allow Travis to help deploy the app on Heroku
deploy:
provider: heroku
api-key:
secure: K0IpFkUH25Z0UvAJDoMXo00WZ4qQmSgZECwmzmhbxTqwzKN8DFDSRSVkP5PloNPRda2tQGkgDHsMMMM1670N+tmfE8ibkQicxJ8cwnUCInfhF1x2VsgtbbDxM8UxIcgWpB0TxnDvFyW1f6Pz6wP8lG0NVC7GCSyKhtnGNHktyGnFN6FEqwE/X56MohfZIOIbGHEOz2FbrNc6idtEOOmcIKJ9z8w/lfqJL0YYjYikqb2IsYX+WDxyZ6bVEos/Swzzml4WoKSx2I8RCH0PVjzAWYZx20FW5K5Un1PJ/yJ0mR2SXZF0Tjf7NUKP5KnosQm4SFAGaLi/81I6JwQbEtaUQ9T1+NV2knlaL8pi/QqLbASPScvNyex15JU5HvkKRgHpR7X5oYlc78xR46GOpFS7HdYUxwduffiqzt5WFmf2qcZaoMRrZWZvyBuaDxrh7ugsVh1oGGAS5uRpeTrfx/6dUdlzHkgn9COYeQMisl3DcuVSMbvHxn3pObLrsRM4kDTWaSLwCkow796jBmTitMZAiZm0ofjryCGh+aw+zPYInDaVyVjhAndZIHziWEwXNRR7AUs3hR2FyBKmWEFRFtePFfcleAAEASAK/ucqhlH/GdzBhrtzaB6CSSVXB1lJ+2rXjw3UH/oT/KzPQPr/p/seRSavmN4Ho9dlzY8XFeLh+7o=
app: coronavirus-tg-api
on:
tags: true
repo: egbakou/coronavirus-tg-api
# Send the message of success after the deploy is done properly
after_deploy:
- export TITLE="New version $TAG is deployed to Heroku production"
- export TEXT=`date`, go to Heroku dashboard and check if the app is running !
- bash ./telegram_notification.sh
#- ./send_to_teams.sh