aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorpaulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com>2020-06-19 17:16:11 +0200
committerGitHub <noreply@github.com>2020-06-19 17:16:11 +0200
commitf39118d499132f017d7f2ec0944bf673b6deb7e9 (patch)
treed92cded89530738b61ab4e6735f9f49a102fc467
parentaf67286adea7da4e01883bb6c60f44a6141e439f (diff)
parent50411cbb2d091a3bca251e8cd1f599928141cb7b (diff)
downloadansible-clever-f39118d499132f017d7f2ec0944bf673b6deb7e9.tar.gz
ansible-clever-f39118d499132f017d7f2ec0944bf673b6deb7e9.tar.zst
ansible-clever-f39118d499132f017d7f2ec0944bf673b6deb7e9.zip
Merge pull request #68 from paulrbr-fl/bug-fix
fix: make sure not to include unecessary ENV variable
-rw-r--r--.travis.yml7
-rw-r--r--README.md1
-rw-r--r--defaults/main.yml1
-rwxr-xr-x[-rw-r--r--]files/clever-set-drain.sh0
-rw-r--r--tests/test-configure-app.yml18
-rw-r--r--tests/test-haskell-app.yml16
-rw-r--r--tests/test-simple-app.yml15
-rw-r--r--tests/test.yml9
8 files changed, 53 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index 0fcb053..752366f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,8 +19,7 @@ install:
19 - printf '[defaults]\nroles_path=../' >ansible.cfg 19 - printf '[defaults]\nroles_path=../' >ansible.cfg
20 20
21script: 21script:
22 # Basic role syntax check 22 # Basic role syntax check & linting
23 - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
24 - ansible-lint . 23 - ansible-lint .
25 - shellcheck **/*.sh 24 - shellcheck **/*.sh
26 - scripts/dhall_check.sh 25 - scripts/dhall_check.sh
@@ -28,7 +27,9 @@ script:
28 - mkdir -p ~/.local/bin 27 - mkdir -p ~/.local/bin
29 - cp tests/fake.sh ~/.local/bin/clever 28 - cp tests/fake.sh ~/.local/bin/clever
30 - cp tests/fake.sh ~/.local/bin/git 29 - cp tests/fake.sh ~/.local/bin/git
31 - ansible-playbook tests/test.yml -i tests/inventory 30 - ansible-playbook tests/test-simple-app.yml -i tests/inventory
31 - ansible-playbook tests/test-haskell-app.yml -i tests/inventory
32 - ansible-playbook tests/test-configure-app.yml -i tests/inventory
32 33
33notifications: 34notifications:
34 slack: fretlink:pTIylIN7zkwRFuL3aHERmsbB 35 slack: fretlink:pTIylIN7zkwRFuL3aHERmsbB
diff --git a/README.md b/README.md
index 7a4557b..c0f7959 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,6 @@ Variables for the application
28 Example: `{ name: pg, env_prefix: POSTGRESQL_ADDON }` 28 Example: `{ name: pg, env_prefix: POSTGRESQL_ADDON }`
29- `clever_app_tasks_file`: tasks file to be executed after environment and addons variables where gathered. Specific to an app, should be use to run migrations. Optional. 29- `clever_app_tasks_file`: tasks file to be executed after environment and addons variables where gathered. Specific to an app, should be use to run migrations. Optional.
30- `clever_haskell_entry_point`: the haskell executable name to be executed by clever cloud, optional. 30- `clever_haskell_entry_point`: the haskell executable name to be executed by clever cloud, optional.
31- _Obsolete_: `clever_entry_point`: Same as above but was replaced by `clever_haskell_entry_point` since v1.14 of this role.
32- `clever_domain`: the domain from which the application should be reachable, optional. 31- `clever_domain`: the domain from which the application should be reachable, optional.
33- _Obsolete_: `domain`: Same as above but was replaced by `clever_domain` since v1.4 of this role. 32- _Obsolete_: `domain`: Same as above but was replaced by `clever_domain` since v1.4 of this role.
34- `clever_syslog_server`: UDP Syslog server to be used as UDPSyslog drain for the application, optional. Example: `udp://198.51.100.51:12345`. 33- `clever_syslog_server`: UDP Syslog server to be used as UDPSyslog drain for the application, optional. Example: `udp://198.51.100.51:12345`.
diff --git a/defaults/main.yml b/defaults/main.yml
index bd3b6a6..4e2ef8e 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -6,7 +6,6 @@ clever_app_root: "{{ app_root | default(playbook_dir + '/..') }}"
6clever_app_confdir: "{{ clever_app_root }}/.clever_cloud" 6clever_app_confdir: "{{ clever_app_root }}/.clever_cloud"
7clever_login_file: "{{ clever_app_confdir }}/login" 7clever_login_file: "{{ clever_app_confdir }}/login"
8 8
9clever_haskell_entry_point: "{{ clever_entry_point | default(None) }}"
10clever_haskell_env: {} 9clever_haskell_env: {}
11clever_env: {} 10clever_env: {}
12 11
diff --git a/files/clever-set-drain.sh b/files/clever-set-drain.sh
index f37498e..f37498e 100644..100755
--- a/files/clever-set-drain.sh
+++ b/files/clever-set-drain.sh
diff --git a/tests/test-configure-app.yml b/tests/test-configure-app.yml
new file mode 100644
index 0000000..06e5e92
--- /dev/null
+++ b/tests/test-configure-app.yml
@@ -0,0 +1,18 @@
1---
2- name: Deploy an app & configure system details on clever
3 hosts: localhost
4 remote_user: root
5 roles:
6 - role: clever
7 vars:
8 clever_token: 123abc
9 clever_secret: cba321
10 clever_app: app_00000000-0000-0000-0000-000000000000
11 clever_domain: my-app.example.org
12 clever_syslog_server: 172.10.0.1:54000
13 clever_build_flavor: M
14 post_tasks:
15 - name: Check CC_RUN_COMMAND is not part of the environment
16 fail:
17 msg: "CC_RUN_COMMAND env variable should not be present in the environment dict"
18 when: clever_env.CC_RUN_COMMAND is defined
diff --git a/tests/test-haskell-app.yml b/tests/test-haskell-app.yml
new file mode 100644
index 0000000..69a25ae
--- /dev/null
+++ b/tests/test-haskell-app.yml
@@ -0,0 +1,16 @@
1---
2- name: Deploy a Haskell app to clever
3 hosts: localhost
4 remote_user: root
5 roles:
6 - role: clever
7 vars:
8 clever_token: 123abc
9 clever_secret: cba321
10 clever_app: app_00000000-0000-0000-0000-000000000000
11 clever_haskell_entry_point: coucou-server
12 post_tasks:
13 - name: Check CC_RUN_COMMAND is present
14 fail:
15 msg: "CC_RUN_COMMAND env variable should be added for Haskell apps"
16 when: not clever_env.CC_RUN_COMMAND is defined
diff --git a/tests/test-simple-app.yml b/tests/test-simple-app.yml
new file mode 100644
index 0000000..e0b905a
--- /dev/null
+++ b/tests/test-simple-app.yml
@@ -0,0 +1,15 @@
1---
2- name: Deploy simple app to clever
3 hosts: localhost
4 remote_user: root
5 roles:
6 - role: clever
7 vars:
8 clever_token: 123abc
9 clever_secret: cba321
10 clever_app: app_00000000-0000-0000-0000-000000000000
11 post_tasks:
12 - name: Check CC_RUN_COMMAND is not part of the environment
13 fail:
14 msg: "CC_RUN_COMMAND env variable should not be present in the environment dict"
15 when: clever_env.CC_RUN_COMMAND is defined
diff --git a/tests/test.yml b/tests/test.yml
deleted file mode 100644
index 663bc6b..0000000
--- a/tests/test.yml
+++ /dev/null
@@ -1,9 +0,0 @@
1---
2- hosts: localhost
3 remote_user: root
4 roles:
5 - role: clever
6 vars:
7 clever_token: 123abc
8 clever_secret: cba321
9 clever_app: app_00000000-0000-0000-0000-000000000000