-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Deploy ITTMS to platform-test | ||
description: Test deployment of an ITTMS review to the platform-test cluster | ||
|
||
inputs: | ||
azure-client-id: | ||
description: Azure service principal or managed identity client ID when using OIDC | ||
required: true | ||
azure-subscription-id: | ||
description: Azure service principal or managed identity subscription ID when using OIDC | ||
required: true | ||
azure-tenant-id: | ||
description: Azure service principal or managed identity tenant ID when using OIDC | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Checkout ITTMS repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: DFE-Digital/itt-mentor-services | ||
path: itt-mentor-services | ||
|
||
- name: Set Environment variables | ||
id: set_env_var | ||
shell: bash | ||
working-directory: itt-mentor-services | ||
run: | | ||
terraform_version=$(awk '/{/{f=/^terraform/;next}f' terraform/application/terraform.tf | grep -o [0-9\.]*) | ||
echo "TERRAFORM_VERSION=$terraform_version" >> $GITHUB_ENV | ||
- name: Use Terraform ${{ env.TERRAFORM_VERSION }} | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
terraform_wrapper: false | ||
|
||
- uses: azure/login@v2 | ||
with: | ||
client-id: ${{ inputs.azure-client-id }} | ||
tenant-id: ${{ inputs.azure-tenant-id }} | ||
subscription-id: ${{ inputs.azure-subscription-id }} | ||
|
||
- uses: DFE-Digital/github-actions/set-kubelogin-environment@master | ||
with: | ||
azure-client-id: ${{ inputs.azure-client-id }} | ||
azure-tenant-id: ${{ inputs.azure-tenant-id }} | ||
azure-subscription-id: ${{ inputs.azure-subscription-id }} | ||
|
||
- name: Terraform apply | ||
shell: bash | ||
working-directory: itt-mentor-services | ||
run: make pt-review ci terraform-apply | ||
env: | ||
DOCKER_IMAGE_TAG: main | ||
PR_NUMBER: 9999 | ||
|
||
- name: Run healthcheck | ||
shell: bash | ||
working-directory: itt-mentor-services | ||
run: | | ||
external_urls=$(terraform -chdir=terraform/application output -json ingress_hostnames | jq -r '.[]') | ||
for url in $external_urls; do | ||
echo "Check health for $url/${{ inputs.healthcheck }}..." | ||
curl -sS --fail "$url/${{ inputs.healthcheck }}" > /dev/null | ||
done |