From a3947fbc79275bb493e53b54abf455b16bc61032 Mon Sep 17 00:00:00 2001 From: Reidar Johansen Date: Tue, 8 Oct 2024 15:25:11 +0200 Subject: [PATCH] Fix parameter bug for ACE v1.6 (#18) * Add breaking version check for ACE v1.6 * Update to ACE v1.6 --- .azuredevops/ms.azure.deploy.yml | 2 +- .github/actions/plan/action.yml | 2 +- README.md | 4 ++-- scripts/azure-cost.sh | 12 +++++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.azuredevops/ms.azure.deploy.yml b/.azuredevops/ms.azure.deploy.yml index 2628e93..ee51e00 100644 --- a/.azuredevops/ms.azure.deploy.yml +++ b/.azuredevops/ms.azure.deploy.yml @@ -47,7 +47,7 @@ variables: - name: SUBSCRIPTION_ID value: d0d0d0d0-ed29-4694-ac26-2e358c364506 - name: VERSION_ACE - value: 1.4 + value: 1.6 - name: WAIT_COUNT value: 30 - name: WAIT_SECONDS diff --git a/.github/actions/plan/action.yml b/.github/actions/plan/action.yml index 99552d6..57582a5 100644 --- a/.github/actions/plan/action.yml +++ b/.github/actions/plan/action.yml @@ -81,7 +81,7 @@ inputs: version_ace_tool: description: "Azure Cost Estimator version." required: false - default: "1.4" + default: "1.6" outputs: providers: description: The Azure resource providers that should be registered. diff --git a/README.md b/README.md index f703b3c..5bd10ce 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ with: See versions at . - Default: **"1.4"** + Default: **"1.6"** ### Usage @@ -288,7 +288,7 @@ env: scope: sub template: main.bicep template_parameters: main.bicepparam # parameters can be passed inline too, like this: namePrefix=t serviceShort=tstsp3 - version_ace_tool: "1.4" + version_ace_tool: "1.6" jobs: plan: diff --git a/scripts/azure-cost.sh b/scripts/azure-cost.sh index d2c6789..31ed08e 100755 --- a/scripts/azure-cost.sh +++ b/scripts/azure-cost.sh @@ -157,9 +157,15 @@ if [[ "${IN_TEMPLATE_PARAMS}" == *'='* ]]; then done fi cmd+=" --currency ${IN_CURRENCY}" -cmd+=' --disable-cache --generateJsonOutput' -cmd+=" --jsonOutputFilename ${LOG_NAME}" -# test out --generate-markdown-output --markdown-output-filename in v5 +cmd+=' --disable-cache' +breakingVer='1.6' +if [ "$(printf '%s\n' "${breakingVer}" "${VERSION_ACE}" | sort -V | head -n1)" = "${breakingVer}" ]; then + cmd+=' --generate-json-output' + cmd+=" --json-output-filename ${LOG_NAME}" +else + cmd+=' --generateJsonOutput' + cmd+=" --jsonOutputFilename ${LOG_NAME}" +fi echo "Run: ${cmd}" eval "${cmd}" 1> >(tee -a "${log}") 2> >(tee -a "${log}" >&2) log_output "${log}" '' ''