ci: use generate-config flag for old CLI versions (#1984)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-06-29 15:46:36 +02:00 committed by GitHub
parent f64e44a438
commit a241a84770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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