From ac951c2c482a0c4a8ac2760986d4f3a954018ede Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Mon, 23 Oct 2023 15:37:38 +0100 Subject: [PATCH 1/6] ch: modify HELPLINE_CODE --- .github/workflows/deploy-multiple-accounts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index c06a41c9..79e5c320 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -171,7 +171,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: ${{matrix.helpline_code}} + helpline-code: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true' From 6b29fb5acdcae5cee4a151c0b019a65f12846a3d Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Mon, 23 Oct 2023 15:48:26 +0100 Subject: [PATCH 2/6] ch: modify HELPLINE_CODE 2 --- .github/workflows/deploy-multiple-accounts.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index 79e5c320..7a71933c 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -123,6 +123,13 @@ jobs: with: ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_POST_SURVEY_BOT_CHAT_URL env_variable_name: POST_SURVEY_BOT_CHAT_URL + + - name: Set Helpline Code + uses: marvinpinto/action-inject-ssm-secrets@latest + with: + ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE + env_variable_name: HELPLINE_CODE + - name: Set AWS credentials for Aselo user uses: marvinpinto/action-inject-ssm-secrets@latest with: @@ -171,7 +178,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE + helpline-code: $HELPLINE_CODE environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true' From 79f4e8efc6a411d2db17aa9457a515005281a109 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Thu, 26 Oct 2023 18:58:58 +0100 Subject: [PATCH 3/6] ch: refactor workflow for helpline-code --- .github/workflows/deploy-multiple-accounts.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index 7a71933c..f7ccc900 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -124,11 +124,19 @@ jobs: ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_POST_SURVEY_BOT_CHAT_URL env_variable_name: POST_SURVEY_BOT_CHAT_URL + - name: Check matrix.helpline-code and set HELPLINE_CODE + run: | + if [[ "${{ matrix.helpline_code }}" == "E2E" ]]; then + export HELPLINE_CODE="${{ matrix.helpline_code }}" + else + # Retrieve the SSM parameter and set HELPLINE_CODE + ssm_value=$(aws ssm get-parameter --name ${{ env.TWILIO_SSM_PREFIX }}_HELPLINE_CODE --query 'Parameter.Value' --output text) + export HELPLINE_CODE="${{ ssm_value }}" + fi + shell: bash + - name: Set Helpline Code - uses: marvinpinto/action-inject-ssm-secrets@latest - with: - ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE - env_variable_name: HELPLINE_CODE + run: echo "HELPLINE_CODE=${{ env.HELPLINE_CODE }}" >> $GITHUB_ENV - name: Set AWS credentials for Aselo user uses: marvinpinto/action-inject-ssm-secrets@latest @@ -178,7 +186,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: $HELPLINE_CODE + helpline-code: ${{env.HELPLINE_CODE}} environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true' From 2bb60bebe9f810aa2097cf0ab903c181a80de053 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Thu, 26 Oct 2023 19:30:36 +0100 Subject: [PATCH 4/6] ch: refactor workflow for helpline-code-2 --- .../workflows/deploy-multiple-accounts.yml | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index f7ccc900..1aad3113 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -124,19 +124,24 @@ jobs: ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_POST_SURVEY_BOT_CHAT_URL env_variable_name: POST_SURVEY_BOT_CHAT_URL - - name: Check matrix.helpline-code and set HELPLINE_CODE + - name: Set Helpline Code for E2E Account + if: matrix.helpline_code == 'E2E' + uses: marvinpinto/action-inject-ssm-secrets@latest + with: + ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE + env_variable_name: HELPLINE_CODE + + - name: Check and Set Helpline Code + if: matrix.helpline_code == 'E2E' + run: | + echo "Setting helpline-code to $HELPLINE_CODE" + echo "HELPLINE_CODE=$HELPLINE_CODE" >> $GITHUB_ENV + + - name: Set Helpline Code (else part) + if: matrix.helpline_code != 'E2E' run: | - if [[ "${{ matrix.helpline_code }}" == "E2E" ]]; then - export HELPLINE_CODE="${{ matrix.helpline_code }}" - else - # Retrieve the SSM parameter and set HELPLINE_CODE - ssm_value=$(aws ssm get-parameter --name ${{ env.TWILIO_SSM_PREFIX }}_HELPLINE_CODE --query 'Parameter.Value' --output text) - export HELPLINE_CODE="${{ ssm_value }}" - fi - shell: bash - - - name: Set Helpline Code - run: echo "HELPLINE_CODE=${{ env.HELPLINE_CODE }}" >> $GITHUB_ENV + echo "Setting helpline-code to matrix.helpline_code" + echo "HELPLINE_CODE=${{ matrix.helpline_code }}" >> $GITHUB_ENV - name: Set AWS credentials for Aselo user uses: marvinpinto/action-inject-ssm-secrets@latest @@ -186,7 +191,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: ${{env.HELPLINE_CODE}} + helpline-code: "${{ env.HELPLINE_CODE }}" environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true' From f959cb089b95724299da736a074293cb271de304 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Thu, 26 Oct 2023 19:31:06 +0100 Subject: [PATCH 5/6] ch: refactor workflow for helpline-code-3 --- .github/workflows/deploy-multiple-accounts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index 1aad3113..afba4263 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -191,7 +191,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: "${{ env.HELPLINE_CODE }}" + helpline-code: "${{env.HELPLINE_CODE}}" environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true' From 0c7efd498d20aba54a9a21bf0279c8c73a5ecf75 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Fri, 27 Oct 2023 10:01:36 +0100 Subject: [PATCH 6/6] ch: add comment --- .github/workflows/deploy-multiple-accounts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index afba4263..0e73559e 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -124,6 +124,8 @@ jobs: ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_POST_SURVEY_BOT_CHAT_URL env_variable_name: POST_SURVEY_BOT_CHAT_URL + # Since we can't provision a lex chat bot with e2e as the helpline code + # we will have to change the helpline code for the E2E account to "ee" on serverless - name: Set Helpline Code for E2E Account if: matrix.helpline_code == 'E2E' uses: marvinpinto/action-inject-ssm-secrets@latest