just get the rg name in the bazel script

This commit is contained in:
miampf 2024-05-16 16:12:15 +02:00
parent 8e40a5c12d
commit 25d1dc7a52
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C
2 changed files with 5 additions and 15 deletions

View File

@ -47,9 +47,7 @@ runs:
ARM_SUBSCRIPTION_ID: ${{ inputs.azureSubscriptionID }}
ARM_TENANT_ID: ${{ inputs.azureTenantID }}
run: |
tfdir=$(mktemp -d)
TF_DIR="$tfdir" bazel run --test_timeout=14400 //e2e/miniconstellation:push_remote_test
echo "terraform-dir=$tfdir" >> $GITHUB_OUTPUT
bazel run --test_timeout=14400 //e2e/miniconstellation:push_remote_test
- name: Log in to azure
# only log in if e2e test failed or if the run was cancelled
@ -63,8 +61,6 @@ runs:
# clean up if e2e test failed or if the run was cancelled
if: (failure() && steps.e2e-test.conclusion == 'failure') || cancelled()
run: |
cd ${{ steps.e2e-test.outputs.terraform-dir }}
terraform init
rg_name=$(terraform output -raw rg_name)
rg_name=${{ steps.e2e-test.outputs.rgname}}
echo "[*] Deleting resource group $rg_name"
az group delete -y --resource-group "$rg_name"

View File

@ -4,7 +4,6 @@ clean_up() {
echo "::group::Terminate"
# terraform destroy -auto-approve
popd
exit 1
echo "::endgroup::"
@ -25,19 +24,14 @@ cd e2e/miniconstellation
echo "::group::Terraform"
if [[ -z "$TF_DIR" ]]; then
TF_DIR="."
fi
cp -n -r * "$TF_DIR"
pushd "$TF_DIR"
terraform init
terraform apply -auto-approve
terraform output -raw ssh_private_key > id_rsa
chmod 600 id_rsa
rg_name=$(terraform output -raw rg_name)
echo "rgname=$rg_name" >> $GITHUB_OUTPUT
azure_vm_ip=$(terraform output -raw public_ip)
echo "::endgroup::"