From 620d14ba65149ad4cd359e43a6aff71c942180ee Mon Sep 17 00:00:00 2001 From: Arsenii Petrovich Date: Sun, 23 Jun 2019 16:50:04 +0300 Subject: [PATCH] Allows user to define BUILD_ variables --- host_vars/all.yml.example | 2 +- roles/main_software/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/host_vars/all.yml.example b/host_vars/all.yml.example index 96295fa..3a98457 100644 --- a/host_vars/all.yml.example +++ b/host_vars/all.yml.example @@ -47,4 +47,4 @@ env_vars: #SPANDEX_SYNC_THRESHOLD: # Spandex and Datadog configuration setting. #BLOCK_COUNT_CACHE_PERIOD: 600 #Time to live of block count cache in milliseconds #ALLOWED_EVM_VERSIONS: "homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg" # the comma-separated list of allowed EVM versions for contracts verification - + #BUILD_* - redefine variables with BUILD_ prefix to override parameters used for building the dev server diff --git a/roles/main_software/tasks/main.yml b/roles/main_software/tasks/main.yml index e7fda0d..51a3337 100644 --- a/roles/main_software/tasks/main.yml +++ b/roles/main_software/tasks/main.yml @@ -115,6 +115,13 @@ server_env: "{{ upper_env | combine({'NETWORK_PATH':'/','PORT':server_port}) }}" tags: - build + +- name: Override build variables + set_fact: + server_env: "{{ server_env | combine({item.key|regex_replace('BUILD_'):item.value}) if item.key | search('BUILD_') else server_env }}" + with_dict: "{{ server_env }}" + tags: + - build - name: Compile BlockScout command: "mix do {{ item }}"