ci: only add tf-log flag if the binary supports it

We sometimes run older CLI versions in the CI. Those versions
may not support the flag.
This commit is contained in:
Otto Bittner 2023-04-28 11:25:45 +02:00
parent 3770cada91
commit 1180b376fa
4 changed files with 22 additions and 4 deletions

View File

@ -184,7 +184,12 @@ runs:
echo "Creating cluster using config:" echo "Creating cluster using config:"
cat constellation-conf.yaml cat constellation-conf.yaml
sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts' || true sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts' || true
constellation create -c ${{ inputs.controlNodesCount }} -w ${{ inputs.workerNodesCount }} -y --force --debug --tf-log=DEBUG
output=$(constellation --help)
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation create -c ${{ inputs.controlNodesCount }} -w ${{ inputs.workerNodesCount }} -y --force --debug ${TFFLAG:-}
- name: Cdbg deploy - name: Cdbg deploy
if: inputs.isDebugImage == 'true' if: inputs.isDebugImage == 'true'

View File

@ -40,4 +40,9 @@ runs:
- name: Constellation terminate - name: Constellation terminate
shell: bash shell: bash
run: constellation terminate --yes --tf-log=DEBUG run: |
output=$(constellation --help)
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation terminate --yes ${TFFLAG:-}

View File

@ -51,11 +51,15 @@ runs:
shell: bash shell: bash
if: inputs.cloudProvider == 'azure' if: inputs.cloudProvider == 'azure'
run: | run: |
output=$(constellation --help)
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation iam create azure \ constellation iam create azure \
--region=${{ inputs.azureRegion }} \ --region=${{ inputs.azureRegion }} \
--resourceGroup="${{ inputs.namePrefix }}-rg" \ --resourceGroup="${{ inputs.namePrefix }}-rg" \
--servicePrincipal="${{ inputs.namePrefix }}-sp" \ --servicePrincipal="${{ inputs.namePrefix }}-sp" \
--generate-config --yes --tf-log=DEBUG --generate-config --yes ${TFFLAG:-}
- name: Constellation iam create gcp - name: Constellation iam create gcp
shell: bash shell: bash

View File

@ -39,4 +39,8 @@ runs:
- name: Delete IAM configuration - name: Delete IAM configuration
shell: bash shell: bash
run: | run: |
constellation iam destroy --yes --tf-log=DEBUG output=$(constellation --help)
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation iam destroy --yes ${TFFLAG:-}