From 4a34ed851b05264543b4b7671d02b51ab5b30b6a Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Mon, 4 Oct 2021 11:40:51 +0100 Subject: [PATCH 1/3] Fix conditionals in get_storage_id The checks for missing storage account ids would never fire as 'null' is not a valid type in bash. This resulted in an empty value for 'ids' being returned causing subsequent errors in the 'az' command (and possibly elsewhere). Update these to the standard bash '-z' check. Also remove the check for null in functions.sh as this case is covered within get_storage_id. --- scripts/functions.sh | 5 ----- scripts/tfstate_azurerm.sh | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index b7bda684..5df8ed01 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -436,11 +436,6 @@ function workspace { echo "@calling workspace function with $@" get_storage_id - if [ "${id}" == "null" ]; then - display_launchpad_instructions - exit 1000 - fi - case "${1}" in "list") workspace_list diff --git a/scripts/tfstate_azurerm.sh b/scripts/tfstate_azurerm.sh index ec7b89aa..078f065a 100644 --- a/scripts/tfstate_azurerm.sh +++ b/scripts/tfstate_azurerm.sh @@ -557,13 +557,13 @@ function get_storage_id { --subscription ${TF_VAR_tfstate_subscription_id} \ --query "[?tags.tfstate=='${TF_VAR_level}' && tags.environment=='${TF_VAR_environment}'].{id:id}[0]" -o json | jq -r .id) - if [[ ${id} == null ]] && [ "${caf_command}" != "launchpad" ]; then + if [[ -z ${id} ]] && [ "${caf_command}" != "launchpad" ]; then # Check if other launchpad are installed id=$(execute_with_backoff az storage account list \ --subscription ${TF_VAR_tfstate_subscription_id} \ --query "[?tags.tfstate=='${TF_VAR_level}'].{id:id}[0]" -o json | jq -r .id) - if [ ${id} == null ]; then + if [[ -z ${id} ]]; then if [ ${TF_VAR_level} != "level0" ]; then echo "You need to initialize that level first before using it or you do not have permission to that level." else From 14c6594f5f9bbe060ac9d87bace43c0604b9694f Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Fri, 15 Oct 2021 00:18:07 +0000 Subject: [PATCH 2/3] Updating package versions --- .env | 16 ++++++++-------- .env.terraform | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 4ebc26e5..a2f232d4 100644 --- a/.env +++ b/.env @@ -1,14 +1,14 @@ -versionAzureCli=2.28.0 +versionAzureCli=2.29.0 versionKubectl=1.22.1 versionGit=1:2.30.2-1ubuntu1 -versionTflint=0.31.0 -versionTflintazrs=0.12.0 -versionVault=1.8.2 +versionTflint=0.33.0 +versionTflintazrs=0.13.2 +versionVault=1.8.4 versionJq=1.6-2.1ubuntu1 versionDockerCompose=1.29.2 -versionTfsec=0.57.1 -versionTerraformDocs=0.14.1 +versionTfsec=0.58.14 +versionTerraformDocs=0.16.0 versionAnsible=2.10.7-1 -versionPacker=1.7.5 -versionCheckov=2.0.344 +versionPacker=1.7.6 +versionCheckov=2.0.489 versionMssqlTools=17.7.1.1 diff --git a/.env.terraform b/.env.terraform index 934500b9..0469ecd4 100644 --- a/.env.terraform +++ b/.env.terraform @@ -1,5 +1,5 @@ 0.13.7 0.14.11 0.15.5 -1.0.6 1.0.7 +1.0.9 From 1222a4189282b0de84acbb267a065fd534a2f799 Mon Sep 17 00:00:00 2001 From: Chun Saen Sean Lok Date: Mon, 18 Oct 2021 11:22:43 +0800 Subject: [PATCH 3/3] Add shared path symlink for modules and providers in rover job --- scripts/functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/functions.sh b/scripts/functions.sh index b7bda684..6d648354 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -189,7 +189,13 @@ function ignite { function setup_rover_job { job_id=$(date '+%Y%m%d%H%M%S%N') job_path="${1}/rover_jobs/${job_id}" + modules_folder="${1}/modules" + providers_folder="${1}/providers" mkdir -p "${job_path}" + mkdir -p "${modules_folder}" + mkdir -p "${providers_folder}" + ln -s ${modules_folder} ${job_path}/modules + ln -s ${providers_folder} ${job_path}/providers echo ${job_path} }