From 7f852026b52fa5a58e5662bfbeb0ce2ab2ffa1b6 Mon Sep 17 00:00:00 2001 From: Jared Holgate Date: Tue, 10 Oct 2023 10:06:11 +0100 Subject: [PATCH] Update the code to use the branch module --- .github/workflows/end-to-end-test.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/end-to-end-test.yml b/.github/workflows/end-to-end-test.yml index 80b95380..f8d9d572 100644 --- a/.github/workflows/end-to-end-test.yml +++ b/.github/workflows/end-to-end-test.yml @@ -40,8 +40,8 @@ jobs: - name: Setup Terraform uses: hashicorp/setup-terraform@v2 with: - terraform_version: ${{ matrix.terraform_version }} - terraform_wrapper: false + terraform_version: ${{ matrix.terraform_version }} + terraform_wrapper: false - name: Setup ALZ Module Inputs run: | @@ -87,7 +87,7 @@ jobs: $Inputs["azure_devops_project_name"] = "alz-test-$uniqueId" $Inputs["azure_devops_authentication_scheme"] = $authScheme } - + $Inputs["apply_approvers"] = "" $Inputs["root_management_group_display_name"] = "Tenant Root Group" $Inputs["additional_files"] = "" @@ -115,8 +115,17 @@ jobs: # Install the Module Install-Module -Name ALZ -Force -Scope CurrentUser -Repository PSGallery + # Get the latest release version + $terraformModuleUrl = "https://github.com/Azure/alz-terraform-accelerator" + $releaseObject = Get-ALZGithubRelease -directoryForReleases "." -githubRepoUrl $terraformModuleUrl -releases "latest" -queryOnly + $release = $($releaseObject.name) + + # Copy the Module into the Release Folder to ensure we are using the code in our branch + New-Item -Path "./$release" -ItemType Directory -Force + Copy-Item -Path "./" -Destination "./$release" -Recurse -Force + # Run the Module - New-ALZEnvironment -IaC "terraform" -cicd $versionControlSystem -inputs "./inputs.json" -autoApprove + New-ALZEnvironment -IaC "terraform" -cicd $versionControlSystem -inputs "./inputs.json" -autoApprove shell: pwsh env: