Skip to content

Commit

Permalink
Merge pull request #757 from hmcts/DTSPO-19088
Browse files Browse the repository at this point in the history
DTSPO-19088 - Transition to MS Graph
  • Loading branch information
JordanHoey96 authored Sep 30, 2024
2 parents 711f2e8 + 6a8b86f commit e680068
Show file tree
Hide file tree
Showing 20 changed files with 495 additions and 314 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/appgateway-auto-shutdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ 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:
Expand All @@ -17,16 +19,48 @@ jobs:
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: App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh stop
- name: Staging - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh stop staging
env:
DEV_ENV: ${{ secrets.DEV_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: 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: 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: 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: App Gateway Auto Shutdown status check
if: env.DEV_ENV != 'true'
run: ./scripts/appgateway/appgw_status.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
40 changes: 37 additions & 3 deletions .github/workflows/appgateway-auto-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
schedule:
- cron: '30 5 * * 1-5' # Every weekday at 6:30am BST
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
permissions:
id-token: write
jobs:
Expand All @@ -17,16 +19,48 @@ jobs:
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: App Gateway Auto Start
run: ./scripts/appgateway/auto-start-stop.sh start
- name: Staging - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start staging
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
DEV_ENV: ${{ env.DEV_ENV }}

- name: Testing - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start testing
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Demo - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start demo
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Development - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start development
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Sandbox - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start sandbox
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: ITHC - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start ithc
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Untagged - App Gateway Auto Shutdown
run: ./scripts/appgateway/auto-start-stop.sh start untagged
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Output log file
run: ./scripts/common/log-output.sh

- name: Wait for App Gateways to start
if: env.DEV_ENV != 'true'
run: sleep 300

- name: App Gateway Auto start status check
if: env.DEV_ENV != 'true'
run: ./scripts/appgateway/appgw_status.sh start ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
4 changes: 2 additions & 2 deletions .github/workflows/flexibleserver-auto-shutdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- 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 }}
run: ./scripts/flexible-server/flexserverstatus.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
4 changes: 2 additions & 2 deletions .github/workflows/flexibleserver-auto-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
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 Start
run: ./scripts/flexible-server/auto-start-stop.sh start staging
env:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- 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 start ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
40 changes: 37 additions & 3 deletions .github/workflows/sqlmi-auto-shutdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
schedule:
- cron: '0 19 * * *' # Every day at 8pm BST
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
permissions:
id-token: write
jobs:
Expand All @@ -17,16 +19,48 @@ jobs:
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: Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop
- name: Staging - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop staging
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
DEV_ENV: ${{ env.DEV_ENV }}

- name: Testing - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop testing
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Demo - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop demo
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Development - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop development
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Sandbox - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop sandbox
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: ITHC - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop ithc
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Untagged - Sql Managed Instance Auto Shutdown
run: ./scripts/sqlmi/auto-start-stop.sh stop untagged
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Output log file
run: ./scripts/common/log-output.sh

- name: Wait for Sql Managed Instance to stop
if: env.DEV_ENV != 'true'
run: sleep 600

- name: Sql Managed Instance status check
if: env.DEV_ENV != 'true'
run: ./scripts/sqlmi/sqlmistatus.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
40 changes: 37 additions & 3 deletions .github/workflows/sqlmi-auto-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
schedule:
- cron: '30 5 * * 1-5' # Every weekday at 6:30am BST
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
permissions:
id-token: write
jobs:
Expand All @@ -17,16 +19,48 @@ jobs:
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: Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start
- name: Staging - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start staging
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
DEV_ENV: ${{ env.DEV_ENV }}

- name: Testing - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start testing
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Demo - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start demo
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Development - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start development
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Sandbox - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start sandbox
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: ITHC - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start ithc
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Untagged - Sql Managed Instance Auto Start
run: ./scripts/sqlmi/auto-start-stop.sh start untagged
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Output log file
run: ./scripts/common/log-output.sh

- name: Wait for Sql Managed Instances to start
if: env.DEV_ENV != 'true'
run: sleep 600

- name: Sql Managed Instance status check
if: env.DEV_ENV != 'true'
run: ./scripts/sqlmi/sqlmistatus.sh start ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
34 changes: 32 additions & 2 deletions .github/workflows/storage-sftp-auto-disable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
schedule:
- cron: "0 19 * * *" # Every day at 8pm BST
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
permissions:
id-token: write
jobs:
Expand All @@ -17,14 +19,42 @@ jobs:
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: disable sftp
run: ./scripts/blob-storage/disable_sftp.sh
- name: Staging - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh staging
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Testing - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh testing
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Demo - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh demo
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Development - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh development
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Sandbox - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh sandbox
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: ITHC - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh ithc
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Untagged - disable sftp
run: ./scripts/blob-storage/disable_sftp.sh untagged
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Output log file
run: ./scripts/common/log-output.sh

- name: Wait for SFTP Servers to stop
if: env.DEV_ENV != 'true'
run: sleep 300

- name: sftp status check
if: env.DEV_ENV != 'true'
run: ./scripts/blob-storage/sftp-check-status.sh stop ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
34 changes: 32 additions & 2 deletions .github/workflows/storage-sftp-auto-enable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
workflow_dispatch:
schedule:
- cron: "30 5 * * 1-5" # Every weekday at 6:30am BST
env:
DEV_ENV: ${{ secrets.DEV_ENV }}
permissions:
id-token: write
jobs:
Expand All @@ -17,14 +19,42 @@ jobs:
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: sftp enable
run: ./scripts/blob-storage/enable_sftp.sh
- name: Staging - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh staging
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Testing - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh testing
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Demo - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh demo
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Development - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh development
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Sandbox - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh sandbox
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: ITHC - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh ithc
env:
DEV_ENV: ${{ env.DEV_ENV }}
- name: Untagged - enable sftp
run: ./scripts/blob-storage/enable_sftp.sh untagged
env:
DEV_ENV: ${{ env.DEV_ENV }}

- name: Output log file
run: ./scripts/common/log-output.sh

- name: Wait for SFTP Servers to start
if: env.DEV_ENV != 'true'
run: sleep 300

- name: sftp status check
if: env.DEV_ENV != 'true'
run: ./scripts/blob-storage/sftp-check-status.sh start ${{ secrets.SHUTDOWN_NOTIFICATIONS_WEBHOOK }}
Loading

0 comments on commit e680068

Please sign in to comment.