From a241a84770b99f39ae6d6122ad25330d6d242926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= <66256922+daniel-weisse@users.noreply.github.com> Date: Thu, 29 Jun 2023 15:46:36 +0200 Subject: [PATCH] ci: use generate-config flag for old CLI versions (#1984) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- .../constellation_iam_create/action.yml | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/actions/constellation_iam_create/action.yml b/.github/actions/constellation_iam_create/action.yml index 2942e0896..28cd1574c 100644 --- a/.github/actions/constellation_iam_create/action.yml +++ b/.github/actions/constellation_iam_create/action.yml @@ -43,10 +43,18 @@ runs: if: inputs.cloudProvider == 'aws' run: | constellation config generate aws + iam_conf_flag="--update-config" + + output=$(constellation iam create --help) + if [[ $output == *"generate-config"* ]]; then + rm constellation-conf.yaml + iam_conf_flag="--generate-config" + fi + constellation iam create aws \ --zone=${{ inputs.awsZone }} \ --prefix=${{ inputs.namePrefix }} \ - --update-config --yes + ${iam_conf_flag} --yes - name: Constellation iam create azure shell: bash @@ -57,22 +65,38 @@ runs: TFFLAG="--tf-log=DEBUG" fi constellation config generate azure + iam_conf_flag="--update-config" + + output=$(constellation iam create --help) + if [[ $output == *"generate-config"* ]]; then + rm constellation-conf.yaml + iam_conf_flag="--generate-config" + fi + constellation iam create azure \ --region=${{ inputs.azureRegion }} \ --resourceGroup="${{ inputs.namePrefix }}-rg" \ --servicePrincipal="${{ inputs.namePrefix }}-sp" \ - --update-config --yes ${TFFLAG:-} + ${iam_conf_flag} --yes ${TFFLAG:-} - name: Constellation iam create gcp shell: bash if: inputs.cloudProvider == 'gcp' run: | constellation config generate gcp + iam_conf_flag="--update-config" + + output=$(constellation iam create --help) + if [[ $output == *"generate-config"* ]]; then + rm constellation-conf.yaml + iam_conf_flag="--generate-config" + fi + constellation iam create gcp \ --projectID=${{ inputs.gcpProjectID }} \ --zone=${{ inputs.gcpZone }} \ --serviceAccountID="${{ inputs.namePrefix }}-sa" \ - --update-config --yes + ${iam_conf_flag} --yes - name: Set existing config id: setExistingConfig