Skip to content

Commit

Permalink
TEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Jan 9, 2025
1 parent 9d118e8 commit 35a1f35
Showing 1 changed file with 123 additions and 121 deletions.
244 changes: 123 additions & 121 deletions .github/workflows/deploy-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Deploy Cluster
on:
push:
branches:
- main
- oidc-smoke-test-2
# - main
pull_request:
branches:
- main
Expand All @@ -15,81 +16,82 @@ on:
- converted_to_draft

jobs:
validate-terraform:
name: Validate Terraform
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate cluster/terraform_aks_cluster
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: cluster/terraform_aks_cluster

- name: Validate cluster/terraform_kubernetes
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: cluster/terraform_kubernetes
terraform_modules_tag: main
terraform_modules_dir: aks

- name: Validate custom_domains/terraform/infrastructure
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: custom_domains/terraform/infrastructure
terraform_modules_tag: testing
terraform_modules_dir: domains

- name: Validate templates/new_service/terraform/application
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: templates/new_service/terraform/application
terraform_modules_tag: main
terraform_modules_dir: aks

- name: Validate templates/new_service/terraform/domains/infrastructure
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: templates/new_service/terraform/domains/infrastructure
terraform_modules_tag: testing
terraform_modules_dir: domains

- name: Validate templates/new_service/terraform/domains/environment_domains
uses: ./.github/actions/validate-terraform
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
terraform_root_folder: templates/new_service/terraform/domains/environment_domains
terraform_modules_tag: testing
terraform_modules_dir: domains

- name: Send Slack notification on failure
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: '#ef5343'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: A Cluster update failure has occurred
SLACK_MESSAGE: |
The terraform validation during cluster update has failed
Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>
# validate-terraform:
# name: Validate Terraform
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - name: Validate cluster/terraform_aks_cluster
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: cluster/terraform_aks_cluster

# - name: Validate cluster/terraform_kubernetes
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: cluster/terraform_kubernetes
# terraform_modules_tag: main
# terraform_modules_dir: aks

# - name: Validate custom_domains/terraform/infrastructure
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: custom_domains/terraform/infrastructure
# terraform_modules_tag: testing
# terraform_modules_dir: domains

# - name: Validate templates/new_service/terraform/application
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: templates/new_service/terraform/application
# terraform_modules_tag: main
# terraform_modules_dir: aks

# - name: Validate templates/new_service/terraform/domains/infrastructure
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: templates/new_service/terraform/domains/infrastructure
# terraform_modules_tag: testing
# terraform_modules_dir: domains

# - name: Validate templates/new_service/terraform/domains/environment_domains
# uses: ./.github/actions/validate-terraform
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# terraform_root_folder: templates/new_service/terraform/domains/environment_domains
# terraform_modules_tag: testing
# terraform_modules_dir: domains

# - name: Send Slack notification on failure
# if: ${{ failure() && github.ref == 'refs/heads/main' }}
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_COLOR: '#ef5343'
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_TITLE: A Cluster update failure has occurred
# SLACK_MESSAGE: |
# The terraform validation during cluster update has failed
# Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>

deploy:
name: Deploy Cluster
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
concurrency: deploy_${{ matrix.environment }}
environment:
name: ${{ matrix.environment }}
needs: [validate-terraform]
# needs: [validate-terraform]
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
environment: [platform-test, test, production]
environment: [platform-test]
# environment: [platform-test, test, production]
permissions:
id-token: write # Required for OIDC authentication to Azure

Expand All @@ -112,58 +114,58 @@ jobs:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
environment: ${{ vars.ITTMS_ENVIRONMENT }}

- name: Send Slack notification on failure
if: failure()
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: '#ef5343'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: A Cluster update failure has occurred
SLACK_MESSAGE: |
The cluster deployment to ${{ matrix.environment }} has failed
Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>
update-domains:
name: Update DNS domains
if: github.ref == 'refs/heads/main'
concurrency: update_domains_${{ matrix.environment }}
environment:
name: ${{ matrix.environment }}
needs: [deploy]
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
environment: [development, production]
steps:
- uses: actions/checkout@v4

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.6.4
terraform_wrapper: false

- name: Set ARM environment variables
uses: DFE-Digital/github-actions/set-arm-environment-variables@master
with:
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}

- name: Update DNS in ${{ matrix.environment }}
run: |
make ci ${{ matrix.environment }} domains-infra-apply
shell: bash
env:
ENVIRONMENT: dummy # "make development" requires the ENVIRONMENT var but it is not used for domains

- name: Send Slack notification on failure
if: failure()
uses: rtCamp/action-slack-notify@master
env:
SLACK_COLOR: '#ef5343'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: A Cluster update failure has occurred
SLACK_MESSAGE: |
The domain update to ${{ matrix.environment }} has failed
Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>
# - name: Send Slack notification on failure
# if: failure()
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_COLOR: '#ef5343'
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_TITLE: A Cluster update failure has occurred
# SLACK_MESSAGE: |
# The cluster deployment to ${{ matrix.environment }} has failed
# Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>

# update-domains:
# name: Update DNS domains
# if: github.ref == 'refs/heads/main'
# concurrency: update_domains_${{ matrix.environment }}
# environment:
# name: ${{ matrix.environment }}
# needs: [deploy]
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 1
# matrix:
# environment: [development, production]
# steps:
# - uses: actions/checkout@v4

# - uses: hashicorp/setup-terraform@v3
# with:
# terraform_version: 1.6.4
# terraform_wrapper: false

# - name: Set ARM environment variables
# uses: DFE-Digital/github-actions/set-arm-environment-variables@master
# with:
# azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
# azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
# azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}

# - name: Update DNS in ${{ matrix.environment }}
# run: |
# make ci ${{ matrix.environment }} domains-infra-apply
# shell: bash
# env:
# ENVIRONMENT: dummy # "make development" requires the ENVIRONMENT var but it is not used for domains

# - name: Send Slack notification on failure
# if: failure()
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_COLOR: '#ef5343'
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_TITLE: A Cluster update failure has occurred
# SLACK_MESSAGE: |
# The domain update to ${{ matrix.environment }} has failed
# Workflow Failed: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View details>

0 comments on commit 35a1f35

Please sign in to comment.