Skip to content

Commit 1118194

Browse files
Start work for testing with travis
1 parent c71b3db commit 1118194

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
3+
### Vagrant template
4+
.vagrant/
5+
6+
### JetBrains template
7+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
8+
9+
*.iml
10+
11+
## Directory-based project format:
12+
.idea/
13+
# if you remove the above rule, at least ignore the following:
14+
15+
# User-specific stuff:
16+
# .idea/workspace.xml
17+
# .idea/tasks.xml
18+
# .idea/dictionaries
19+
20+
# Sensitive or high-churn files:
21+
# .idea/dataSources.ids
22+
# .idea/dataSources.xml
23+
# .idea/sqlDataSources.xml
24+
# .idea/dynamic.xml
25+
# .idea/uiDesigner.xml
26+
27+
# Gradle:
28+
# .idea/gradle.xml
29+
# .idea/libraries
30+
31+
# Mongo Explorer plugin:
32+
# .idea/mongoSettings.xml
33+
34+
## File-based project format:
35+
*.ipr
36+
*.iws
37+
38+
## Plugin-specific files:
39+
40+
# IntelliJ
41+
/out/
42+
43+
# mpeltonen/sbt-idea plugin
44+
.idea_modules/
45+
46+
# JIRA plugin
47+
atlassian-ide-plugin.xml
48+
49+
# Crashlytics plugin (for Android Studio and IntelliJ)
50+
com_crashlytics_export_strings.xml
51+
crashlytics.properties
52+
crashlytics-build.properties
53+

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
sudo: required
3+
dist: trusty
4+
language: generic
5+
6+
matrix:
7+
include:
8+
- env: ANSIBLE_VERSION=ppa:ansible/ansible
9+
- env: ANSIBLE_VERSION=ppa:ansible/ansible-1.9
10+
11+
before_install:
12+
- sudo apt-get -y install software-properties-common
13+
- sudo apt-add-repository -y $ANSIBLE_VERSION
14+
- sudo apt-get -y update
15+
- sudo apt-get -y install ansible
16+
- ansible --version
17+
18+
script:
19+
- echo localhost > inventory
20+
- ansible-playbook -i inventory --connection=local --sudo -v test/test.yml

test/roles/local-ansistrano

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.

test/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
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
16+
hosts: all
17+
vars:
18+
ansistrano_deploy_to: "/tmp/my-app.com"
19+
roles:
20+
- { 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)