-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
46 lines (43 loc) · 1.31 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
sudo: required
dist: focal
stages:
- name: Tests
- name: Push
- name: Deploy
jobs:
include:
- stage: Tests
name: Docker build Tests
language: python
python: '3.8'
services:
- docker
before_script: pip install docker-compose
script:
- docker-compose run --rm garfieldbot sh -c "python bot.py"
- stage: Push
name: Docker build Push
script:
- docker build -t raghavtinker/garfieldbot .
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
- docker push raghavtinker/garfieldbot
- stage: Deploy
name: Deploy bot to server
language: python
python: '3.8'
cache: pip
before_install:
# ssh keys
- openssl aes-256-cbc -K $encrypted_b06a1a195e3f_key -iv $encrypted_b06a1a195e3f_iv
-in deploymentFiles/ansible.enc -out ./ansible -d
- chmod 600 ansible
# docker compose file
- openssl aes-256-cbc -K $encrypted_5a553d836f7c_key -iv $encrypted_5a553d836f7c_iv
-in deploymentFiles/docker-compose.yml.enc -out ./playbooks/docker-compose.yml -d
# ansible_hosts
- openssl aes-256-cbc -K $encrypted_ad2b00579d77_key -iv $encrypted_ad2b00579d77_iv
-in deploymentFiles/ansible_hosts.enc -out ./ansible_hosts -d
install:
- pip install ansible
script:
- ansible-playbook playbooks/deploy.yml