Skip to content

Commit 193df1d

Browse files
committed
CCM-10294: temp testing change
1 parent b82d5fc commit 193df1d

File tree

3 files changed

+28
-26
lines changed

3 files changed

+28
-26
lines changed

.github/workflows/dispatch_internal_repo_workflow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
- name: Trigger nhs-notify-internal workflow
5959
shell: bash
6060
run: |
61+
echo "debugging=$GITHUB_ENV"
6162
DISPATCH_EVENT=$(jq -ncM \
6263
--arg infraRepoName "${{ inputs.infraRepoName }}" \
6364
--arg releaseVersion ${{ inputs.releaseVersion }} \

.github/workflows/stage-4-acceptance.yaml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ jobs:
3232
echo '${{ toJson(github) }}'
3333
REF=${{ github.ref }}
3434
echo "REF=$REF"
35-
pwd
36-
ls
37-
ls ./scripts
38-
. ./scripts/sandbox-utils.sh "$REF"
35+
SANDBOX_NAME=$(./scripts/sandbox-utils.sh "$REF")
36+
echo "SANDBOX_NAME=$SANDBOX_NAME"
37+
echo "BEFORE: $GITHUB_ENV"
38+
echo "SANDBOX_NAME=$SANDBOX_NAME" >> $GITHUB_ENV
39+
echo "AFTER: $GITHUB_ENV"
3940
4041
sandbox-set-up:
4142
name: Step 1
@@ -69,19 +70,19 @@ jobs:
6970
targetAccountGroup: nhs-notify-template-management-dev
7071
targetComponent: sandbox
7172

72-
# sandbox-tear-down:
73-
# name: Step 3
74-
# needs: acceptance-tests
75-
# if: always()
73+
sandbox-tear-down:
74+
name: Step 3
75+
needs: acceptance-tests
76+
if: always()
7677

77-
# uses: ./.github/workflows/dispatch_internal_repo_workflow.yaml
78-
# secrets: inherit
79-
# with:
80-
# jobName: Sandbox tear down
81-
# infraRepoName: nhs-notify-web-template-management
82-
# releaseVersion: ${{ github.head_ref || github.ref_name }}
83-
# targetWorkflow: dispatch-deploy-dynamic-env.yaml
84-
# targetEnvironment: pr${{ github.event.number }}
85-
# targetAccountGroup: nhs-notify-template-management-dev
86-
# targetComponent: sandbox
87-
# terraformAction: destroy
78+
uses: ./.github/workflows/dispatch_internal_repo_workflow.yaml
79+
secrets: inherit
80+
with:
81+
jobName: Sandbox tear down
82+
infraRepoName: nhs-notify-web-template-management
83+
releaseVersion: ${{ github.head_ref || github.ref_name }}
84+
targetWorkflow: dispatch-deploy-dynamic-env.yaml
85+
targetEnvironment: pr${{ github.event.number }}
86+
targetAccountGroup: nhs-notify-template-management-dev
87+
targetComponent: sandbox
88+
terraformAction: destroy

scripts/sandbox-utils.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
function generateSandboxName() {
2-
# Example: feature/CCM-00000_branch-description
2+
# Example: refs/heads/feature/CCM-00000_branch-description
33
REF=$1
44

5-
# Example: feature/ccm-00000_branch-description -> feature/CCm-00000_branch-desCription
5+
# Example: refs/heads/feature/ccm-00000_branch-description -> refs/heads/feature/CCm-00000_branch-desCription
66
SANITISED_REF1=${REF//c/C}
77

8-
# Example: feature/CCm-00000_branch-desCription -> feature/CCM-00000_branch-desCription
8+
# Example: refs/heads/feature/CCm-00000_branch-desCription -> refs/heads/feature/CCM-00000_branch-desCription
99
SANITISED_REF2=${SANITISED_REF1//m/M}
1010

11-
# Example: 00000_branch-description
11+
# Example: 00000_branch-desCription
1212
END_REF=(${SANITISED_REF2##*CCM-})
1313

1414
if [[ $END_REF == $SANITISED_REF2 ]]; then
@@ -19,15 +19,15 @@ function generateSandboxName() {
1919
TICKET_NUMBER=${END_REF%%[_-]*}
2020
fi
2121

22-
# Example: 04f106adc56fc0460853351c314b670d -
22+
# Example: 32c80a37bd6ff73554bb26a7e8ddeec3 -
2323
HASH=$(md5sum <<<"$REF")
2424

25-
# Example: 0000004f106adc56fc0460853351c314b670d -
25+
# Example: 0000032c80a37bd6ff73554bb26a7e8ddeec3 -
2626
LONG_SANDBOX_NAME="$TICKET_NUMBER""$HASH"
2727

2828
MAX_SANDBOX_LENGTH=8
2929

30-
# Example: 0000004f
30+
# Example: 0000032c
3131
SANDBOX_NAME=${LONG_SANDBOX_NAME:0:MAX_SANDBOX_LENGTH}
3232
echo "$SANDBOX_NAME"
3333
}

0 commit comments

Comments
 (0)