Skip to content

Commit

Permalink
Clean up code after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
RMcVelia committed Jan 9, 2024
1 parent c56ea61 commit 45cc7a8
Show file tree
Hide file tree
Showing 28 changed files with 128 additions and 244 deletions.
8 changes: 4 additions & 4 deletions .github/common_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
SLACK_SUCCESS: '#00ff00'
SLACK_ICON: https://raw.githubusercontent.com/DFE-Digital/get-into-teaching-api/master/.github/image.png?size=48
SLACK_USERNAME: GiT Workflows
SLACK_FOOTER: Get Into Teaching Application and Content
SLACK_FOOTER: Get Into Teaching Application and Content
DOCKER_REPOSITORY: ghcr.io/dfe-digital/get-into-teaching-frontend
DOMAIN: london.cloudapps.digital
DOMAIN: teacherservices.cloud
APPLICATION: Get Into Teaching Application and Content
REVIEW_APPLICATION: review-get-into-teaching-app
PAAS_APPLICATION_NAME: get-into-teaching-app
REVIEW_APPLICATION: get-into-teaching-app-review
AKS_APPLICATION_NAME: get-into-teaching-app
10 changes: 0 additions & 10 deletions .github/common_environment_aks.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy to AKS

inputs:
environment:
description: The environment to deploy to Development/Test/Production/Review/Speed/UR etc
description: The environment to deploy to Development/Test/Production/Review etc
required: true
sha:
description: Commit sha to be deployed
Expand All @@ -14,8 +14,6 @@ inputs:
required: true
KEY_VAULT:
required: true
ARM_ACCESS_KEY:
required: true

runs:
using: composite
Expand All @@ -25,8 +23,10 @@ runs:

- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master

- uses: DFE-Digital/github-actions/set-arm-environment-variables@master
with:
var_file: .github/common_environment_aks.yml
azure-credentials: ${{ inputs.AZURE_CREDENTIALS }}

- uses: azure/login@v1
with:
Expand All @@ -49,12 +49,12 @@ runs:
echo "TERRAFORM_VERSION=$terraform_version" >> $GITHUB_ENV
case ${{ inputs.environment }} in
review_aks)
review)
pr_name="${{env.REVIEW_APPLICATION}}-${{inputs.pr}}"
echo "pr_name=${pr_name}" >> $GITHUB_OUTPUT
echo "healthcheck=${pr_name}${cluster_domain}" >> $GITHUB_OUTPUT
;;
production_aks)
production)
echo "healthcheck=${{env.AKS_APPLICATION_NAME}}-${appenv}" >> $GITHUB_OUTPUT
;;
*)
Expand All @@ -80,18 +80,16 @@ runs:

- name: Terraform init, plan & apply
shell: bash
run: make ${{ inputs.environment }} ci terraform-apply-aks
run: make ${{ inputs.environment }} ci terraform-apply
env:
ARM_ACCESS_KEY: ${{ inputs.ARM_ACCESS_KEY }}
DOCKER_IMAGE_TAG: sha-${{ steps.sha.outputs.short}}
PR_NUMBER: ${{ inputs.pr }}
CONFIRM_PRODUCTION: true

- name: Smoke tests
shell: bash
if: ${{ inputs.environment != 'Speed' && inputs.environment != 'pagespeed' }}
run: |
tests/confidence/healthcheck_aks.sh "${{steps.variables.outputs.healthcheck}}" "sha-${{ steps.sha.outputs.short }}"
tests/confidence/healthcheck.sh "${{steps.variables.outputs.healthcheck}}" "sha-${{ steps.sha.outputs.short }}"
env:
HTTPAUTH_PASSWORD: ${{ steps.fetch-secrets.outputs.HTTP_PASSWORD }}
HTTPAUTH_USERNAME: ${{ steps.fetch-secrets.outputs.HTTP_USERNAME }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ name: owasp

inputs:
environment:
description: The environment to deploy to Development/Test/Production/Review/Speed/UR etc
description: The environment to deploy to Development/Test/Production/Review etc
required: true
AZURE_CREDENTIALS:
required: true
KEY_VAULT:
required: true
ARM_ACCESS_KEY:
required: true
GITHUB_TOKEN:
required: true

Expand Down Expand Up @@ -41,18 +39,16 @@ runs:
- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master
with:
var_file: .github/common_environment_aks.yml

- name: Setup Application Name
id: app_name
shell: bash
run: |
if [[ "${{ inputs.environment }}" == "production_aks" ]] ; then
if [[ "${{ inputs.environment }}" == "production" ]] ; then
rval="${{env.AKS_APPLICATION_NAME}}-production.${{env.DOMAIN}}"
elif [[ "${{ inputs.environment }}" == "test_aks" ]] ; then
elif [[ "${{ inputs.environment }}" == "test" ]] ; then
rval="${{env.AKS_APPLICATION_NAME}}-test.test.${{env.DOMAIN}}"
elif [[ "${{ inputs.environment }}" == "development_aks" ]] ; then
elif [[ "${{ inputs.environment }}" == "development" ]] ; then
rval="${{env.AKS_APPLICATION_NAME}}-development.test.${{env.DOMAIN}}"
fi
echo "SCAN=${rval}" >> $GITHUB_OUTPUT
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/build-no-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,20 @@ jobs:

- name: set-up-environment
uses: DFE-Digital/github-actions/set-up-environment@master
with:
var_file: .github/common_environment_aks.yml

- uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_AKS_REVIEW }}
creds: ${{ secrets.AZURE_CREDENTIALS_REVIEW }}

- name: Fetch secrets from key vault
uses: azure/CLI@v1
id: keyvault-yaml-secret
with:
inlineScript: |
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.KEY_VAULT_AKS_REVIEW }}" --query "value" -o tsv)
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.KEY_VAULT_REVIEW }}" --query "value" -o tsv)
echo "::add-mask::$SLACK_WEBHOOK"
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
SNYK_TOKEN=$(az keyvault secret show --name "SNYK-TOKEN" --vault-name "${{ secrets.KEY_VAULT_AKS_REVIEW }}" --query "value" -o tsv)
SNYK_TOKEN=$(az keyvault secret show --name "SNYK-TOKEN" --vault-name "${{ secrets.KEY_VAULT_REVIEW }}" --query "value" -o tsv)
echo "::add-mask::$SNYK_TOKEN"
echo "SNYK_TOKEN=$SNYK_TOKEN" >> $GITHUB_OUTPUT
Expand Down
Loading

0 comments on commit 45cc7a8

Please sign in to comment.