ci: add Terraform logging (#1665)

* enable Terraform logging

* change to debug level

* rename artifact

* add name suffix

* remove blank line
This commit is contained in:
Moritz Sanft 2023-04-27 14:03:49 +02:00 committed by GitHub
parent 1825c11790
commit 261fe611a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 60 additions and 11 deletions

View File

@ -184,7 +184,7 @@ 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 constellation create -c ${{ inputs.controlNodesCount }} -w ${{ inputs.workerNodesCount }} -y --force --debug --tf-log=DEBUG
- name: Cdbg deploy - name: Cdbg deploy
if: inputs.isDebugImage == 'true' if: inputs.isDebugImage == 'true'

View File

@ -40,4 +40,4 @@ runs:
- name: Constellation terminate - name: Constellation terminate
shell: bash shell: bash
run: constellation terminate --yes run: constellation terminate --yes --tf-log=DEBUG

View File

@ -55,7 +55,7 @@ runs:
--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 --generate-config --yes --tf-log=DEBUG
- name: Constellation iam create gcp - name: Constellation iam create gcp
shell: bash shell: bash

View File

@ -3,14 +3,14 @@ description: Delete previously created IAM configuration.
inputs: inputs:
cloudProvider: cloudProvider:
description: "Either 'aws', 'azure' or 'gcp'." description: "Either 'aws', 'azure' or 'gcp'."
required: true required: true
gcpServiceAccount: gcpServiceAccount:
description: "GCP service account to use for authentication." description: "GCP service account to use for authentication."
required: false required: false
azureCredentials: azureCredentials:
description: "Azure service principal to use for authentication." description: "Azure service principal to use for authentication."
required: false required: false
runs: runs:
using: "composite" using: "composite"
@ -39,4 +39,4 @@ runs:
- name: Delete IAM configuration - name: Delete IAM configuration
shell: bash shell: bash
run: | run: |
constellation iam destroy --yes constellation iam destroy --yes --tf-log=DEBUG

View File

@ -79,7 +79,10 @@ outputs:
kubeconfig: kubeconfig:
description: "The kubeconfig for the cluster." description: "The kubeconfig for the cluster."
value: ${{ steps.constellation-create.outputs.kubeconfig }} value: ${{ steps.constellation-create.outputs.kubeconfig }}
namePrefix:
description: "The name prefix of the cloud resources used in the e2e test."
value: ${{ steps.create-prefix.outputs.prefix }}
runs: runs:
using: "composite" using: "composite"
steps: steps:

View File

@ -0,0 +1,16 @@
name: Upload Terraform logs
description: "Upload the Terraform log file as an artifact."
inputs:
artifactNameSuffix:
description: "Name suffix for the created artifact."
required: true
runs:
using: "composite"
steps:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: terraform-logs-${{ inputs.artifactNameSuffix }}
path: terraform.log

View File

@ -104,6 +104,12 @@ jobs:
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }} azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com" gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
- name: Always upload Terraform logs
if: always()
uses: ./.github/actions/upload_terraform_logs
with:
artifactNameSuffix: ${{ steps.e2e_test.outputs.namePrefix }}
- name: Notify about failure - name: Notify about failure
if: | if: |
failure() && failure() &&

View File

@ -276,3 +276,9 @@ jobs:
cloudProvider: ${{ inputs.cloudProvider }} cloudProvider: ${{ inputs.cloudProvider }}
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }} azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com" gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
- name: Always upload Terraform logs
if: always()
uses: ./.github/actions/upload_terraform_logs
with:
artifactNameSuffix: ${{ steps.e2e_test.outputs.namePrefix }}

View File

@ -216,6 +216,12 @@ jobs:
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }} azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com" gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
- name: Always upload Terraform logs
if: always()
uses: ./.github/actions/upload_terraform_logs
with:
artifactNameSuffix: ${{ steps.e2e_test.outputs.namePrefix }}
e2e-upgrade: e2e-upgrade:
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -242,6 +242,12 @@ jobs:
kubernetesVersion: ${{ matrix.kubernetes-version }} kubernetesVersion: ${{ matrix.kubernetes-version }}
provider: ${{ matrix.provider }} provider: ${{ matrix.provider }}
- name: Always upload Terraform logs
if: always()
uses: ./.github/actions/upload_terraform_logs
with:
artifactNameSuffix: ${{ steps.e2e_test.outputs.namePrefix }}
e2e-upgrade: e2e-upgrade:
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -200,6 +200,12 @@ jobs:
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }} azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com" gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
- name: Always upload Terraform logs
if: always()
uses: ./.github/actions/upload_terraform_logs
with:
artifactNameSuffix: ${{ steps.e2e_test.outputs.namePrefix }}
- name: Notify about failure - name: Notify about failure
if: | if: |
failure() && failure() &&