From 245eac8aa4a7f0f5a572531e54cf8c0995ac010c Mon Sep 17 00:00:00 2001 From: miampf Date: Thu, 16 May 2024 16:12:15 +0200 Subject: [PATCH] just get the rg name in the bazel script --- .github/actions/e2e_mini/action.yml | 8 ++------ e2e/miniconstellation/main.sh.in | 12 +++--------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/actions/e2e_mini/action.yml b/.github/actions/e2e_mini/action.yml index e82b7b621..4e11c2207 100644 --- a/.github/actions/e2e_mini/action.yml +++ b/.github/actions/e2e_mini/action.yml @@ -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" diff --git a/e2e/miniconstellation/main.sh.in b/e2e/miniconstellation/main.sh.in index e67af13cf..362cb3c9c 100755 --- a/e2e/miniconstellation/main.sh.in +++ b/e2e/miniconstellation/main.sh.in @@ -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::"