-
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.
Merge pull request #341 from DFE-Digital/oidc-smoke-test
[2151] Github actions OIDC
- Loading branch information
Showing
17 changed files
with
178 additions
and
121 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
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,73 @@ | ||
name: Test application deployment | ||
description: Test deployment of an ITTMS review app to the cluster | ||
|
||
inputs: | ||
azure-client-id: | ||
description: Azure managed identity client ID for OIDC authentication | ||
required: true | ||
azure-subscription-id: | ||
description: Azure managed identity subscription ID for OIDC authentication | ||
required: true | ||
azure-tenant-id: | ||
description: Azure managed identity tenant ID for OIDC authentication | ||
required: true | ||
environment: | ||
description: The application environment config | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Check out ITTMS repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: DFE-Digital/itt-mentor-services | ||
path: itt-mentor-services | ||
ref: 843-github-actions-oidc # Remove this line when the 843-github-actions-oidc branch is merged | ||
|
||
- 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: 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: Deploy application to ${{ inputs.environment }} | ||
shell: bash | ||
working-directory: itt-mentor-services | ||
run: make ${{ inputs.environment }} 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 external_urls | jq -r '.[]') | ||
for url in $external_urls; do | ||
echo "Check health for $url/healthcheck/all..." | ||
curl -sS --fail "$url/healthcheck/all" > /dev/null | ||
done | ||
- name: Delete application | ||
shell: bash | ||
working-directory: itt-mentor-services | ||
run: make ${{ inputs.environment }} ci terraform-destroy | ||
env: | ||
DOCKER_IMAGE_TAG: main | ||
PR_NUMBER: 9999 |
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
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
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
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
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,5 @@ | ||
AZURE_SUBSCRIPTION=s189-teacher-services-cloud-production | ||
AZURE_RESOURCE_PREFIX=s189p01 | ||
CONFIG_SHORT=tscdomains | ||
DISABLE_KEYVAULTS=true | ||
TERRAFORM_MODULES_TAG=stable |
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
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
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
Oops, something went wrong.