From 37bdd77f7937628452e523dd6d0f39e4b59ad7ba Mon Sep 17 00:00:00 2001 From: Ieuan Byers Date: Mon, 7 Oct 2024 08:34:18 +0100 Subject: [PATCH 1/2] Re-enable jobs --- .github/workflows/aks-auto-shutdown.yaml | 58 ++++----- .../workflows/appgateway-auto-shutdown.yaml | 114 +++++++++--------- .../flexibleserver-auto-shutdown.yaml | 114 +++++++++--------- .github/workflows/vm-auto-shutdown.yaml | 58 ++++----- 4 files changed, 172 insertions(+), 172 deletions(-) diff --git a/.github/workflows/aks-auto-shutdown.yaml b/.github/workflows/aks-auto-shutdown.yaml index 19fc0df3..8e7474c8 100644 --- a/.github/workflows/aks-auto-shutdown.yaml +++ b/.github/workflows/aks-auto-shutdown.yaml @@ -1,34 +1,34 @@ -# name: aks-auto-shutdown -# on: -# workflow_dispatch: -# schedule: -# - cron: '0 19,22 * * *' # Every day at 20:00 and 23:00 BST -# permissions: -# id-token: write -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 +name: aks-auto-shutdown +on: + workflow_dispatch: + schedule: + - cron: "0 19,22 * * *" # Every day at 20:00 and 23:00 BST +permissions: + id-token: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 -# - name: 'Az CLI login' -# uses: azure/login@v2 -# with: -# client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown -# tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET -# allow-no-subscriptions: true + - name: "Az CLI login" + uses: azure/login@v2 + with: + client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown + tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET + allow-no-subscriptions: true -# - name: AKS Auto Shutdown -# run: ./scripts/aks/auto-start-stop.sh stop -# env: -# DEV_ENV: ${{ secrets.DEV_ENV }} + - name: AKS Auto Shutdown + run: ./scripts/aks/auto-start-stop.sh stop + env: + DEV_ENV: ${{ secrets.DEV_ENV }} -# - name: Output log file -# run: ./scripts/common/log-output.sh + - name: Output log file + run: ./scripts/common/log-output.sh -# - name: Wait for clusters to stop -# run: sleep 600 + - name: Wait for clusters to stop + run: sleep 600 -# - name: AKS Auto Shutdown status check -# run: ./scripts/aks/auto-shutdown-status.sh stop ${{ secrets.REGISTRYSLACKWEBHOOK }} + - name: AKS Auto Shutdown status check + run: ./scripts/aks/auto-shutdown-status.sh stop ${{ secrets.REGISTRYSLACKWEBHOOK }} diff --git a/.github/workflows/appgateway-auto-shutdown.yaml b/.github/workflows/appgateway-auto-shutdown.yaml index 2d3cdea5..07c3afcc 100644 --- a/.github/workflows/appgateway-auto-shutdown.yaml +++ b/.github/workflows/appgateway-auto-shutdown.yaml @@ -1,66 +1,66 @@ -# name: AppGateway-auto-shutdown -# on: -# workflow_dispatch: -# schedule: -# - cron: '0 19,22 * * *' # Every day at 20:00 and 23:00 BST -# env: -# DEV_ENV: ${{ secrets.DEV_ENV }} -# permissions: -# id-token: write -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: 'Az CLI login' -# uses: azure/login@v2 -# with: -# client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown -# tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET -# allow-no-subscriptions: true -# - name: Staging - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop staging -# env: -# DEV_ENV: ${{ env.DEV_ENV }} +name: AppGateway-auto-shutdown +on: + workflow_dispatch: + schedule: + - cron: "0 19,22 * * *" # Every day at 20:00 and 23:00 BST +env: + DEV_ENV: ${{ secrets.DEV_ENV }} +permissions: + id-token: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: "Az CLI login" + uses: azure/login@v2 + with: + client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown + tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET + allow-no-subscriptions: true + - name: Staging - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop staging + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Testing - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop testing -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Testing - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop testing + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Demo - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop demo -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Demo - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop demo + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Development - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop development -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Development - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop development + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Sandbox - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop sandbox -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Sandbox - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop sandbox + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: ITHC - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop ithc -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: ITHC - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop ithc + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Untagged - App Gateway Auto Shutdown -# run: ./scripts/appgateway/auto-start-stop.sh stop untagged -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Untagged - App Gateway Auto Shutdown + run: ./scripts/appgateway/auto-start-stop.sh stop untagged + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Output log file -# run: ./scripts/common/log-output.sh + - name: Output log file + run: ./scripts/common/log-output.sh -# - name: Wait for App Gateways to stop -# if: env.DEV_ENV != 'true' -# run: sleep 300 + - name: Wait for App Gateways to stop + if: env.DEV_ENV != 'true' + run: sleep 300 -# - name: App Gateway Auto Shutdown status check -# if: env.DEV_ENV != 'true' -# run: ./scripts/appgateway/appgw_status.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} + - name: App Gateway Auto Shutdown status check + if: env.DEV_ENV != 'true' + run: ./scripts/appgateway/appgw_status.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} diff --git a/.github/workflows/flexibleserver-auto-shutdown.yaml b/.github/workflows/flexibleserver-auto-shutdown.yaml index 5890bfe9..40dea09b 100644 --- a/.github/workflows/flexibleserver-auto-shutdown.yaml +++ b/.github/workflows/flexibleserver-auto-shutdown.yaml @@ -1,67 +1,67 @@ -# name: flexible-server-auto-shutdown -# on: -# workflow_dispatch: -# schedule: -# - cron: '0 19 * * *' # Every day at 8pm BST -# env: -# DEV_ENV: ${{ secrets.DEV_ENV }} -# permissions: -# id-token: write -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: 'Az CLI login' -# uses: azure/login@v2 -# with: -# client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown -# tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET -# allow-no-subscriptions: true +name: flexible-server-auto-shutdown +on: + workflow_dispatch: + schedule: + - cron: "0 19 * * *" # Every day at 8pm BST +env: + DEV_ENV: ${{ secrets.DEV_ENV }} +permissions: + id-token: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: "Az CLI login" + uses: azure/login@v2 + with: + client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown + tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET + allow-no-subscriptions: true -# - name: Staging - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop staging -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Staging - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop staging + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Test - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop testing -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Test - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop testing + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Demo - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop demo -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Demo - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop demo + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Development - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop development -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Development - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop development + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Sandbox - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop sandbox -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Sandbox - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop sandbox + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: ITHC - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop ithc -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: ITHC - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop ithc + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Untagged - Postgres Flexible server Auto Stop -# run: ./scripts/flexible-server/auto-start-stop.sh stop untagged -# env: -# DEV_ENV: ${{ env.DEV_ENV }} + - name: Untagged - Postgres Flexible server Auto Stop + run: ./scripts/flexible-server/auto-start-stop.sh stop untagged + env: + DEV_ENV: ${{ env.DEV_ENV }} -# - name: Output log file -# run: ./scripts/common/log-output.sh + - name: Output log file + run: ./scripts/common/log-output.sh -# - name: Wait for Flexible servers to start -# if: env.DEV_ENV != 'true' -# run: sleep 600 + - name: Wait for Flexible servers to start + if: env.DEV_ENV != 'true' + run: sleep 600 -# - name: Postgres Flexible server status check -# if: env.DEV_ENV != 'true' -# run: ./scripts/flexible-server/flexserverstatus.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} + - name: Postgres Flexible server status check + if: env.DEV_ENV != 'true' + run: ./scripts/flexible-server/flexserverstatus.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} diff --git a/.github/workflows/vm-auto-shutdown.yaml b/.github/workflows/vm-auto-shutdown.yaml index 08e82072..4d8c5bdc 100644 --- a/.github/workflows/vm-auto-shutdown.yaml +++ b/.github/workflows/vm-auto-shutdown.yaml @@ -1,32 +1,32 @@ -# name: vm-auto-shutdown -# on: -# workflow_dispatch: -# schedule: -# - cron: '0 19,22 * * *' # Every day at 20:00 and 23:00 BST -# permissions: -# id-token: write -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: 'Az CLI login' -# uses: azure/login@v2 -# with: -# client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown -# tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET -# allow-no-subscriptions: true -# - name: VM Auto Shutdown -# run: ./scripts/vm/auto-start-stop.sh deallocate -# env: -# DEV_ENV: ${{ secrets.DEV_ENV }} +name: vm-auto-shutdown +on: + workflow_dispatch: + schedule: + - cron: "0 19,22 * * *" # Every day at 20:00 and 23:00 BST +permissions: + id-token: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: "Az CLI login" + uses: azure/login@v2 + with: + client-id: 2b6fa9d7-7dba-4600-a58a-5e25554997aa # DTS AKS Auto-Shutdown + tenant-id: 531ff96d-0ae9-462a-8d2d-bec7c0b42082 # HMCTS.NET + allow-no-subscriptions: true + - name: VM Auto Shutdown + run: ./scripts/vm/auto-start-stop.sh deallocate + env: + DEV_ENV: ${{ secrets.DEV_ENV }} -# - name: Output log file -# run: ./scripts/common/log-output.sh + - name: Output log file + run: ./scripts/common/log-output.sh -# - name: Wait for VMs to stop -# run: sleep 600 + - name: Wait for VMs to stop + run: sleep 600 -# - name: VM Auto Shutdown status check -# run: ./scripts/vm/vmstatus.sh deallocate ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} + - name: VM Auto Shutdown status check + run: ./scripts/vm/vmstatus.sh deallocate ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }} From 1756ee706786d6cb1afce0fa0223ad07f73ff4f2 Mon Sep 17 00:00:00 2001 From: Ieuan Byers Date: Mon, 7 Oct 2024 08:45:43 +0100 Subject: [PATCH 2/2] Change single quotes to double --- .github/workflows/parsegithubissue.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/parsegithubissue.yaml b/.github/workflows/parsegithubissue.yaml index 5e3cd570..e1a91d0f 100644 --- a/.github/workflows/parsegithubissue.yaml +++ b/.github/workflows/parsegithubissue.yaml @@ -91,11 +91,11 @@ jobs: #Save parsed date into environment variables - name: Save parsed jsonString data run: | - echo '${{ steps.parse_issue.outputs.jsonString }}' > NEW_DATA.json + echo "${{ steps.parse_issue.outputs.jsonString }}" > NEW_DATA.json echo NEW_DATA=$(cat NEW_DATA.json | jq -c | jq '.form_environment |= split(",")') >> $GITHUB_ENV rm NEW_DATA.json - echo GITHUB_REPO='${{ github.repository }}' >> $GITHUB_ENV - echo ISSUE_NUMBER='${{ github.event.issue.number }}' >> $GITHUB_ENV + echo GITHUB_REPO="${{ github.repository }}" >> $GITHUB_ENV + echo ISSUE_NUMBER="${{ github.event.issue.number }}" >> $GITHUB_ENV #Setup Python - uses: actions/setup-python@v5 with: