File tree Expand file tree Collapse file tree 3 files changed +12
-28
lines changed Expand file tree Collapse file tree 3 files changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,12 @@ before_install:
1414 - sudo apt-get -y update
1515 - sudo apt-get -y install ansible
1616 - ansible --version
17+ # We download the latest deploy stable tag
18+ - sudo ansible-galaxy install carlosbuenosvinos.ansistrano-deploy
1719
1820script :
1921 - echo localhost > inventory
2022 - ansible-playbook -i inventory test/test.yml --syntax-check
21- # - ansible-playbook -i inventory --connection=local --sudo -v test/test.yml
23+ - ansible-playbook -i inventory --connection=local --sudo -v test/deploy.yml
24+ - ansible-playbook -i inventory --connection=local --sudo -v test/deploy.yml
25+ - ansible-playbook -i inventory --connection=local --sudo -v test/test.yml
Original file line number Diff line number Diff line change 1+ - name : Do a deploy to be able to rollback
2+ hosts : all
3+ vars :
4+ ansistrano_deploy_to : " /tmp/my-app.com"
5+ roles :
6+ - { role: carlosbuenosvinos.ansistrano-deploy }
Original file line number Diff line number Diff line change 11---
2- - name : Given no previous deploy
3- hosts : all
4- vars :
5- ansistrano_deploy_to : " /tmp/my-app.com"
6- tasks :
7- - name : Assert ansistrano_deploy_to path does not exist
8- stat :
9- path : " {{ ansistrano_deploy_to }}"
10- register : st
11- - debug :
12- msg : " Path does not exist and is a directory"
13- when : st.stat.exists is defined and not st.stat.exists
14-
15- - name : When rolling back
2+ - name : Rolling back
163 hosts : all
174 vars :
185 ansistrano_deploy_to : " /tmp/my-app.com"
196 roles :
207 - { role: local-ansistrano }
21-
22- - name : Then an error should be throw
23- hosts : all
24- vars :
25- ansistrano_deploy_to : " /tmp/my-app.com"
26- tasks :
27- - name : Assert ansistrano_deploy_to path does exist
28- stat :
29- path : " {{ ansistrano_deploy_to }}"
30- register : st
31- - debug :
32- msg : " Path exists and is a directory"
33- when : st.stat.exists is defined and st.stat.exists
You can’t perform that action at this time.
0 commit comments