Skip to content

Commit

Permalink
CI: Contentful integration email (#346)
Browse files Browse the repository at this point in the history
* Contentful integration complete

* CMS python file added

* Code refactored

* Code updated to display status from user selecting from a list on the CMS

* Changed the code to work with the radio button option added on the CMS for the user

* Integrated the help centre page with Contentful for categories of items to show.

* Methods catalogue page panel deleted

* Abort added back

* Updated the methods table to remove access

* Linting errors corrected

* Pipfile lock updated

* Merged with main

* 1.0.0

Automatically generated by python-semantic-release

* 1.0.0

Automatically generated by python-semantic-release

* add header attributes

* ensure methods are assigned to correct tables

* update second table to match

* add url link for method summary

* add url for ready methods

* add conditional clause to future methods table

* simplify code

* refactoring

* debug method summary page

* remove redundant term

* add release link support

* retain consistency with variables

* fix bug with detail content link

* retain layout consistency with current website

* missing end of quote

* fix release term issue

* formatting

* formatting changes

* formatting changes

* ignore formatting error

* get help centre structure from contentful

* continue to use contentful structure

* add error handling & clean up

* partially derive page content from contentful

* add error handling for missing sub pages

* remove external link page filtering

* unused variable

* remove content overwriting

* ensure methods-request page is also derived from contentful

* integrate methods-request into contentful

* formatting fixes

* CMS Markdown template created

* First draft of the CMS markdown document is complete

* CMS MD updated

* CMS MD moved to root of the repo

* correct accessibility statement page title

* add accessibility statement page to contentful

* remove redundant imports

* update tests to reflect title change

* resolve issue with methods request page

* integrate privacy page into contentful

* fix issue with bullet list

* update variable names

* Code formatted & confluence link removed from CMS.md file

* add contentful secrets to concourse

* add contentful params to live pipeline

* export variables to env

* remove tokens from dev pipeline

* use temp file to read cms tokens

* rename variables for use with poetry

* empty commit

* empty commit

* reformatting

* print statements

* print testing

* rename env variables

* fixing syntax

* use github secret to check env variables

* Merge branch 'main' into contentful-integration

Signed-off-by: jasonbellONS <[email protected]>

# Conflicts:
#	CMS.md
#	ci/tasks/build_and_deploy/build_files.sh
#	poetry.lock
#	pyproject.toml
#	sml_builder/__init__.py
#	sml_builder/cms.py
#	sml_builder/help_centre.py
#	sml_builder/method.py
#	sml_builder/page.py
#	sml_builder/templates/about.html
#	sml_builder/templates/accessibility_statement.html
#	sml_builder/templates/content/privacy.html
#	sml_builder/templates/help-methods-request.html
#	sml_builder/templates/help_category.html
#	sml_builder/templates/index.html
#	sml_builder/templates/method.html
#	sml_builder/templates/methods.html

* Amending Pipeline

Signed-off-by: jasonbellONS <[email protected]>

* Amending Pipeline

Signed-off-by: jasonbellONS <[email protected]>

* Amending Pipeline

Signed-off-by: jasonbellONS <[email protected]>

* running poetry lock

Signed-off-by: jasonbellONS <[email protected]>

* running poetry lock

Signed-off-by: jasonbellONS <[email protected]>

* amending box used for email

Signed-off-by: jasonbellONS <[email protected]>

* amending box used for email

Signed-off-by: jasonbellONS <[email protected]>

* Adding in pip install

Signed-off-by: jasonbellONS <[email protected]>

* Amending script

Signed-off-by: jasonbellONS <[email protected]>

---------

Signed-off-by: jasonbellONS <[email protected]>
Co-authored-by: sanjeevz3009 <[email protected]>
Co-authored-by: semantic-release <semantic-release>
Co-authored-by: Joseph-Percival-ONS <[email protected]>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent 3418b3c commit d7e6a4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ci/live-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ env_setups:
<<: *general_preprod_params
ACCOUNT_NAME: &account sml_preprod
AWS_SERVICE_ROLE: &role arn:aws:iam::((aws_account_sml_preprod)):role/spp-concourse-sml-deployment-preprod
cms_email_list: ((cms_email_list))
GOV_NOTIFY: ((gov_notify_test))
CMS_EMAIL_LIST: ((cms_email_list))
GOV_NOTIFY: ((gov_notify_live))
TF_VAR_aws_account_id: ((aws_account_sml_preprod))
TF_VAR_deployment_role: *role
TF_VAR_environment: preprod
Expand Down
8 changes: 4 additions & 4 deletions ci/tasks/util/email_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

set -euo pipefail

: ${cms_email_list}
: ${gov_notify_test}
: ${CMS_EMAIL_LIST}
: ${GOV_NOTIFY}
: ${status}

pip install notifications-python-client
Expand All @@ -15,6 +15,6 @@ arr=($tag)
export STATUS=$status
export FIRSTNAME=${arr[*]:0:1}
export SURNAME=${arr[*]:1:2}
export EMAIL=${grep "$firstname $surname" "$cms_email_list" | sed -n -e 's/^.*: //p'}
export GOVNOTIFYAPIKEY=$gov_notify_test
export EMAIL=${echo "$CMS_EMAIL_LIST" | grep "$firstname $surname"| sed 's/.*://'}
export GOVNOTIFYAPIKEY=$GOV_NOTIFY
python ci/tasks/util/send_email.py

0 comments on commit d7e6a4f

Please sign in to comment.