-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from clementd-fretlink/service-dependencies
Service dependencies
- Loading branch information
Showing
10 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
let ServiceDependency = | ||
< Addon : { addon_id : Text } | Application : { app_id : Text } > | ||
|
||
let addon = λ(addon_id : Text) → ServiceDependency.Addon { addon_id = addon_id } | ||
|
||
let application = | ||
λ(app_id : Text) → ServiceDependency.Application { app_id = app_id } | ||
|
||
in { Type = ServiceDependency, addon = addon, application = application } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
{ Addon = ./Addon.dhall, Config = ./Config.dhall, Vault = ./Vault.dhall } | ||
{ Addon = ./Addon.dhall | ||
, ServiceDependency = ./ServiceDependency.dhall | ||
, Config = ./Config.dhall | ||
, Vault = ./Vault.dhall | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- name: Make sure addon {{ service_dep.addon_id }} is linked | ||
shell: > | ||
clever service link-addon {{ service_dep.addon_id }} | ||
args: | ||
chdir: "{{ clever_app_root }}" | ||
environment: | ||
CONFIGURATION_FILE: "{{ clever_login_file }}" | ||
when: service_dep.addon_id is defined | ||
|
||
- name: Make sure app {{ service_dep.app_id }} is linked | ||
shell: > | ||
clever service link-app {{ service_dep.app_id }} | ||
args: | ||
chdir: "{{ clever_app_root }}" | ||
environment: | ||
CONFIGURATION_FILE: "{{ clever_login_file }}" | ||
when: service_dep.app_id is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Deploy an app & configure service dependencies on clever | ||
hosts: localhost | ||
remote_user: root | ||
pre_tasks: | ||
- file: | ||
state: absent | ||
path: ../clever-commands | ||
roles: | ||
- role: clever | ||
vars: | ||
clever_token: 123abc | ||
clever_secret: cba321 | ||
clever_app: app_00000000-0000-0000-0000-000000000000 | ||
clever_service_dependencies: | ||
- app_id: app_00000000-2222-2222-2222-000000000000 | ||
- addon_id: addon_00000000-0000-0000-0000-000000000000 | ||
post_tasks: | ||
- name: Check stubbed commands | ||
shell: "{{ item.cmd }}" | ||
ignore_errors: true | ||
vars: | ||
display: "{{ item.display }}" | ||
with_list: | ||
- cmd: "grep service ../clever-commands" | ||
display: "Expected 'clever service' command to be called" | ||
register: tests_results | ||
- name: show results | ||
debug: | ||
msg: | ||
- "failed_results: {{ failed_results }}" | ||
- "success_results: {{ success_results }}" | ||
failed_when: tests_results is failed | ||
vars: | ||
failed_results: "{{ tests_results.results | selectattr('failed') | map(attribute='item.display') | list }}" | ||
success_results: "{{ tests_results.results | rejectattr('failed') | map(attribute='item.display') | list }}" |