diff --git a/.github/actions/deploy-environment/action.yml b/.github/actions/deploy-environment/action.yml index 16dca4d1f..51787a6e0 100644 --- a/.github/actions/deploy-environment/action.yml +++ b/.github/actions/deploy-environment/action.yml @@ -36,6 +36,12 @@ runs: DOCKER_IMAGE_TAG: ${{ inputs.docker-image }} PR_NUMBER: ${{ inputs.pull-request-number }} + - name: Set up Terraform outputs as env vars + shell: bash + run: | + echo "CLAIMS_EXTERNAL_HOST=$(terraform output -raw claims_web_external_hostname)" >> $GITHUB_ENV + echo "PLACEMENTS_EXTERNAL_HOST=$(terraform output -raw placements_web_external_hostname)" >> $GITHUB_ENV + - name: Set up Ruby 3.2.2 uses: ruby/setup-ruby@v1 with: @@ -53,5 +59,5 @@ runs: run: bin/bundle exec rspec --tag smoke_test -b env: SMOKE_TEST: "true" - CLAIMS_EXTERNAL_HOST: "track-and-pay-${{ inputs.environment }}.test.teacherservices.cloud" - PLACEMENTS_EXTERNAL_HOST: "manage-school-placements-${{ inputs.environment }}.test.teacherservices.cloud" + CLAIMS_EXTERNAL_HOST: ${{ env.CLAIMS_EXTERNAL_HOST }} + PLACEMENTS_EXTERNAL_HOST: ${{ env.PLACEMENTS_EXTERNAL_HOST }} diff --git a/terraform/application/output.tf b/terraform/application/output.tf index 989dbad14..8e0c042be 100644 --- a/terraform/application/output.tf +++ b/terraform/application/output.tf @@ -1,3 +1,9 @@ -output "url" { - value = module.web_application.url +# Access the first hostname +output "claims_web_external_hostname" { + value = module.web_application.web_external_hostnames[0] +} + +# Access the second hostname +output "placements_external_hostname" { + value = module.web_application.web_external_hostnames[1] }