Skip to content

Commit 16c1d02

Browse files
committed
test an actual rollback, no assertions for now
1 parent 6bf5847 commit 16c1d02

File tree

3 files changed

+12
-28
lines changed

3 files changed

+12
-28
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

1820
script:
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

test/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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 }

test/test.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
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

0 commit comments

Comments
 (0)