Skip to content

Commit

Permalink
adding sftp workflow steps
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanHoey96 committed Sep 30, 2024
1 parent a5e5f2a commit 6a8b86f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 5 deletions.
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 }}
2 changes: 1 addition & 1 deletion scripts/appgateway/appgw_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
APPLICATION_GATEWAYS=$(get_application_gateways "$2")

# For each App Gateway found in the function `get_application_gateways` start another loop
jq -c '.[]' <<<$APPLICATION_GATEWAYS | while read application_gateway; do
jq -c '.data[]' <<<$APPLICATION_GATEWAYS | while read application_gateway; do
# Function that returns the Resource Group, Id and Name of the Application Gateway and its current state as variables
get_application_gateways_details

Expand Down

0 comments on commit 6a8b86f

Please sign in to comment.