-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
63 lines (46 loc) · 2.83 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
language: python
python:
- '3.8'
services:
- docker
addons:
ssh_known_hosts: 104.41.159.59
before_install:
#- cp .env.example .env
- cp .test.env.example .env
install:
- make install
before_script:
- docker-compose -f docker-compose-test.yml up -d
- docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD
script:
- make wait-for-db && make test
- make flake8
- docker build -t my-django-backend-app .
- docker images
- docker tag my-django-backend-app:latest $DOCKER_HUB_USERNAME/my-django-backend-app:production
- docker images
- docker push $DOCKER_HUB_USERNAME/my-django-backend-app:production
#after_success: skip
#after_failure: skip
# START ------ if and only if deployment is active -----
before_deploy:
- openssl aes-256-cbc -K $encrypted_f4eabd9cea96_key -iv $encrypted_f4eabd9cea96_iv -in deploy_key.pem.enc -out /tmp/deploy_key.pem -d
- eval "$(ssh-agent -s)" # start the ssh agent
- chmod 600 /tmp/deploy_key.pem # this key should have push access
- ssh-add /tmp/deploy_key.pem # Add the private key to SSH
deploy:
provider: script
cleanup: true
script: bash trigger-post-receive-hook-script.sh
on:
branch: main
#after_deploy: skip
# END ------ if and only if deployment is active -----
after_script:
- docker-compose -f docker-compose-test.yml down --volumes #stop containers and remove containers, networks, volumes
- docker rmi -f my-django-backend-app
env:
global:
- secure: xJxOR/eyoy5ZYAqDz0MlkcP4U+YopASAs8vN3fRyvxRdhswCx8xCyXdEBBdQOtJh/JDvlrb1w0TXSFlsyOMoAahW3aSmv44pYYccQEWugTIf6MW2IbdUOFp97nODglptTfww8yJ1pLXVFTPEr7IKDk3qXOaqa7gH12mF8xPTIg85rlC7EyDVuhG/UIfQTZhr73xXKOsklp7GWntCcGAvH/6US+SGlt6n8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