aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--dhall/Config.dhall2
-rwxr-xr-xfiles/clever-set-build-flavor.sh9
-rw-r--r--tasks/deploy.yml9
-rw-r--r--tasks/setup.yml1
5 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md
index 469667b..ef14393 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ Variables for the application
35- _Obsolete_: `clever_metrics`: metrics used to be disabled by default. Now they are enabled by default and can be explicitly disabled with `clever_disable_metrics`. 35- _Obsolete_: `clever_metrics`: metrics used to be disabled by default. Now they are enabled by default and can be explicitly disabled with `clever_disable_metrics`.
36- `clever_disable_metrics`: a boolean to disable metrics support. Optional, default to `false`. 36- `clever_disable_metrics`: a boolean to disable metrics support. Optional, default to `false`.
37- `clever_env_output_file`: as a post deploy task you might need to retrieve the full Clever environment configuration (i.e. with addon env variables). If this variable is set to a filename then the env will be retrieved after a successful deploy inside this file. Optional. 37- `clever_env_output_file`: as a post deploy task you might need to retrieve the full Clever environment configuration (i.e. with addon env variables). If this variable is set to a filename then the env will be retrieved after a successful deploy inside this file. Optional.
38- `clever_build_flavor`: an optional text value used to configure the size of the dedicated build instance (for instance `S` or `XL`). If not defined, it delegates to clever cloud default behaviour. Setting `disabled` disables the dedicated build instance altogether.
38 39
39Variables specific to deployment, default should be fine: 40Variables specific to deployment, default should be fine:
40- `clever_cli_version`: Version of clever cli tools, default to `0.9.3`. 41- `clever_cli_version`: Version of clever cli tools, default to `0.9.3`.
diff --git a/dhall/Config.dhall b/dhall/Config.dhall
index 1b9388e..e092e2c 100644
--- a/dhall/Config.dhall
+++ b/dhall/Config.dhall
@@ -15,6 +15,7 @@ let Config =
15 , clever_disable_metrics : Bool 15 , clever_disable_metrics : Bool
16 , clever_addons : List Addon 16 , clever_addons : List Addon
17 , clever_env : Environment 17 , clever_env : Environment
18 , clever_build_flavor : Optional Text
18 } 19 }
19 20
20let mkConfig = 21let mkConfig =
@@ -32,6 +33,7 @@ let mkConfig =
32 , clever_disable_metrics = False 33 , clever_disable_metrics = False
33 , clever_addons = [] : List Addon 34 , clever_addons = [] : List Addon
34 , clever_env = {=} 35 , clever_env = {=}
36 , clever_build_flavor = None Text
35 } 37 }
36 : Config {} 38 : Config {}
37 39
diff --git a/files/clever-set-build-flavor.sh b/files/clever-set-build-flavor.sh
new file mode 100755
index 0000000..52ad223
--- /dev/null
+++ b/files/clever-set-build-flavor.sh
@@ -0,0 +1,9 @@
1#!/usr/bin/env bash
2
3set -e
4
5function setBuildFlavor {
6 clever scale --build-flavor "${BUILD_FLAVOR}"
7}
8
9setBuildFlavor
diff --git a/tasks/deploy.yml b/tasks/deploy.yml
index 751d78f..5e0ba0c 100644
--- a/tasks/deploy.yml
+++ b/tasks/deploy.yml
@@ -16,6 +16,15 @@
16 DOMAIN: "{{ clever_domain | default(domain) }}" 16 DOMAIN: "{{ clever_domain | default(domain) }}"
17 CONFIGURATION_FILE: "{{ clever_login_file }}" 17 CONFIGURATION_FILE: "{{ clever_login_file }}"
18 18
19- name: Configure Build Instance
20 when: clever_build_flavor is defined
21 command: "{{ ansible_env.HOME }}/{{ clever_user_path }}/clever-set-build-flavor.sh"
22 args:
23 chdir: "{{ clever_app_root }}"
24 environment:
25 BUILD_FLAVOR: "{{ clever_build_flavor }}"
26 CONFIGURATION_FILE: "{{ clever_login_file }}"
27
19- name: Push Environment 28- name: Push Environment
20 shell: "clever env import --json < {{ clever_app_confdir }}/env" 29 shell: "clever env import --json < {{ clever_app_confdir }}/env"
21 args: 30 args:
diff --git a/tasks/setup.yml b/tasks/setup.yml
index a2d5b90..3bf7965 100644
--- a/tasks/setup.yml
+++ b/tasks/setup.yml
@@ -29,3 +29,4 @@
29 with_items: 29 with_items:
30 - clever-set-domain.sh 30 - clever-set-domain.sh
31 - clever-set-drain.sh 31 - clever-set-drain.sh
32 - clever-set-build-flavor.sh