Skip to content

Commit

Permalink
Merge pull request #538 from usagov/stage
Browse files Browse the repository at this point in the history
HOTFIX Sprint 52 release to PROD
  • Loading branch information
rayestrada authored Feb 6, 2024
2 parents b45dae4 + 4217631 commit 97fda40
Show file tree
Hide file tree
Showing 33 changed files with 376 additions and 95 deletions.
52 changes: 50 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ jobs:
source ./scripts/pipeline/exports.sh ${CIRCLE_BRANCH}
source ./scripts/pipeline/cloud-gov-login.sh
source ./scripts/pipeline/cloud-gov-deploy.sh
post-deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- attach_workspace:
at: ~/
- run:
name: "Install cloudfoundry dependencies"
command: |
source ./scripts/pipeline/deb-basic-deps.sh
source ./scripts/pipeline/deb-cf-install.sh
- run:
name: "Post Deploy"
command: |
source ./scripts/pipeline/exports.sh ${CIRCLE_BRANCH}
source ./scripts/pipeline/cloud-gov-login.sh
source ./scripts/pipeline/cloud-gov-post-deploy.sh
post-deploy-upkeep:
docker:
- image: cimg/base:stable
steps:
- checkout
- attach_workspace:
at: ~/
- run:
name: "Install cloudfoundry dependencies"
command: |
source ./scripts/pipeline/deb-basic-deps.sh
source ./scripts/pipeline/deb-cf-install.sh
- run:
name: "Post Deploy Upkeep"
command: |
source ./scripts/pipeline/exports.sh ${CIRCLE_BRANCH}
source ./scripts/pipeline/cloud-gov-login.sh
source ./scripts/pipeline/cloud-gov-post-deploy-upkeep.sh
downsync:
docker:
- image: cimg/base:stable
Expand Down Expand Up @@ -283,7 +319,7 @@ workflows:
- stage
requires:
- build-theme
- upkeep:
- post-deploy:
filters:
branches:
only:
Expand All @@ -292,6 +328,15 @@ workflows:
- stage
requires:
- deploy
- post-deploy-upkeep:
filters:
branches:
only:
- test
- dev
- stage
requires:
- post-deploy
# - cypress:
# filters:
# branches:
Expand All @@ -315,9 +360,12 @@ workflows:
- deploy:
requires:
- build-theme
- upkeep:
- post-deploy:
requires:
- deploy
- post-deploy-upkeep:
requires:
- post-deploy
upkeep-workflow:
when:
and:
Expand Down
16 changes: 3 additions & 13 deletions config/sync/core.entity_view_display.node.voter_guide.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ content:
label: hidden
settings: { }
third_party_settings: { }
weight: 2
region: content
content_moderation_control:
settings: { }
third_party_settings: { }
weight: -20
weight: 0
region: content
field_basics_block:
type: entity_reference_revisions_entity_view
Expand All @@ -36,16 +31,11 @@ content:
view_mode: default
link: ''
third_party_settings: { }
weight: 3
region: content
field_subtitle:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 1
region: content
hidden:
content_moderation_control: true
field_subtitle: true
langcode: true
links: true
published_at: true
15 changes: 15 additions & 0 deletions config/sync/language.entity.hmn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
uuid: 6f595da0-2695-4fe9-8e45-68181f6fed62
langcode: hmn
status: true
dependencies:
module:
- disable_language
third_party_settings:
disable_language:
disable: true
redirect_language: en
id: hmn
label: Hmong
direction: ltr
weight: -1
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.km.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: km
label: Khmer
direction: ltr
weight: -1
weight: 0
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: ko
label: Korean
direction: ltr
weight: 0
weight: 1
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.nv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: nv
label: Navajo
direction: ltr
weight: 1
weight: 2
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: pt
label: Portuguese
direction: ltr
weight: 2
weight: 3
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: ru
label: Russian
direction: ltr
weight: 3
weight: 4
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.tl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: tl
label: Tagalog
direction: ltr
weight: 4
weight: 5
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.vi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: vi
label: Vietnamese
direction: ltr
weight: 5
weight: 6
locked: false
2 changes: 1 addition & 1 deletion config/sync/language.entity.ypk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies: { }
id: ypk
label: Yupʼik-Akuzipik
direction: ltr
weight: 6
weight: 7
locked: false
2 changes: 2 additions & 0 deletions config/sync/language.negotiation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ url:
pt: pt
ar: ar
fr: fr
hmn: hmn
domains:
en: ''
es: ''
Expand All @@ -41,4 +42,5 @@ url:
pt: ''
ar: ''
fr: ''
hmn: ''
selected_langcode: site_default
1 change: 1 addition & 0 deletions config/sync/language/hmn/core.date_format.long_date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pattern: 'l, j F, Y'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pattern: 'd F, Y'
1 change: 1 addition & 0 deletions config/sync/language/hmn/language.entity.hmn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Hmoob
3 changes: 3 additions & 0 deletions config/sync/language/hmn/metatag.metatag_defaults.front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tags:
description: 'Nrhiav Kev Sau Npe Mus Pov Ntawv hauv lub xeev koj nyob.'
title: 'Sau npe mus pov ntawv | [site:name] ua lus Hmoob'
3 changes: 3 additions & 0 deletions config/sync/language/hmn/metatag.metatag_defaults.global.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tags:
description: 'Nrhiav Kev Sau Npe Mus Pov Ntawv hauv lub xeev koj nyob.'
title: 'Sau npe mus pov ntawv | [site:name] ua lus Hmoob'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tags:
description: 'Nrhiav saib seb yuav sau npe mus pov ntawv xaiv tsa hauv [current-page:title] li cas'
title: 'Kev sau npe pov ntawv xaiv tsa hauv [current-page:title] | [site:name] ua lus Hmoob'
28 changes: 0 additions & 28 deletions scripts/pipeline/cloud-gov-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
#!/bin/bash

wait_for_task(){
task_id=$1
count=0
echo "task id: '${task_id}'"
while : ; do
status=$(cf tasks ${project}-drupal-${CIRCLE_BRANCH} | awk -v task_id="${task_id}" '$1==task_id {print $3}')
echo "status: ${status:-NA}"
if [ "${status}" = "SUCCEEDED" ]; then
break
elif [ "${status}" = "FAILED" ]; then
echo "Task failed!"
kill -SIGPIPE "$$"
elif [ "${count}" -gt "60" ]; then
echo "Task timed out!"
kill -SIGPIPE "$$"
else
echo "Waiting for task '${task_id}'..."
sleep 5
count=$((${count}+1))
fi
done
}

mv manifest.yml manifest.tmp
envsubst < manifest.tmp > manifest.yml

Expand All @@ -33,8 +10,3 @@ cf push --strategy rolling

cf add-network-policy ${project}-drupal-${CIRCLE_BRANCH} ${proxy_name} -s ${proxy_space} --protocol tcp --port ${proxy_port}
cf add-network-policy ${waf_name} ${project}-drupal-${CIRCLE_BRANCH} -s "${project}-${space}" --protocol tcp --port ${drupal_port}
echo "Running post deploy steps..."
task_id=$(cf run-task ${project}-drupal-${CIRCLE_BRANCH} --command "./scripts/post-deploy" --name "${project}-${CIRCLE_BRANCH}-post-deploy" -k "2G" -m "256M" | grep 'task id:' | awk '{print $NF}')
wait_for_task ${task_id}
echo "Running static site export..."
task_id=$(cf run-task ${project}-drupal-${CIRCLE_BRANCH} --command "./scripts/build_static" --name "${project}-${CIRCLE_BRANCH}-tome" -k "2G" -m "256M")
2 changes: 2 additions & 0 deletions scripts/pipeline/cloud-gov-post-deploy-upkeep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Running upkeep..."
cf ssh ${project}-drupal-${CIRCLE_BRANCH} --command "PATH=/home/vcap/deps/1/bin:/home/vcap/deps/0/bin:/usr/local/bin:/usr/bin:/bin:/home/vcap/app/php/bin:/home/vcap/app/php/sbin:/home/vcap/app/php/bin:/home/vcap/app/vendor/drush/drush app/scripts/upkeep >/dev/null 2>&1"
2 changes: 2 additions & 0 deletions scripts/pipeline/cloud-gov-post-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Running post deploy steps..."
cf ssh ${project}-drupal-${CIRCLE_BRANCH} --command "PATH=/home/vcap/deps/1/bin:/home/vcap/deps/0/bin:/usr/local/bin:/usr/bin:/bin:/home/vcap/app/php/bin:/home/vcap/app/php/sbin:/home/vcap/app/php/bin:/home/vcap/app/vendor/drush/drush app/scripts/post-deploy >/dev/null 2>&1"
2 changes: 1 addition & 1 deletion scripts/post-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ drush s3fs-cl -y --scheme=public --condition=newer

drush cr
drush state:set system.maintenance_mode 0 -y
echo "Bootstrap finished"
echo "Post deploy finished!"
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Test Content Editor Role Access', () => {

// content editor should not have access to url to delete banner
cy.request({
url: '/admin/structure/block/manage/views_block__sitewide_alert_block_1/delete',
url: '/admin/structure/block-content/manage/sitewide_alert',
failOnStatusCode:false,
}).then((resp) => {
expect(resp.status).to.eq(403)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Test Content Manager Role Access', () => {

// content manager should not have access to url to delete banner
cy.request({
url: '/admin/structure/block/manage/views_block__sitewide_alert_block_1/delete',
url: '/admin/structure/block-content/manage/sitewide_alert',
failOnStatusCode:false,
}).then((resp) => {
expect(resp.status).to.eq(403)
Expand Down
5 changes: 3 additions & 2 deletions testing/cypress/e2e/backEndTests/footer-menu-editor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ describe('Footer Menu Function', () => {
// check that the link is working as expected
cy.visit('/')

cy.get('[data-test="footer"]').find('[class="usa-list usa-list--unstyled identifier-links"]').then(link => {
cy.get(link[0]).find('a').should('contain', 'Cypress Test Link').should('have.attr', 'href').and('contain', 'bixal.com')
cy.get('[data-test="footer"]').find('[class="usa-footer__primary-content mobile-lg:grid-col-4 desktop:grid-col-auto"]').then(link => {
cy.get(link[0]).find('a').should('contain', 'Cypress Test Link')
// .should('have.attr', 'href').and('contain', 'bixal.com')
})

// after delete the link that was created
Expand Down
2 changes: 1 addition & 1 deletion testing/cypress/e2e/backEndTests/site-admin-access.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Test Site Admin Role access', () => {
})

// site admin should be able to delete banner
cy.request('/admin/structure/block/manage/views_block__sitewide_alert_block_1/delete').then((response) => {
cy.request('/admin/structure/block-content/manage/sitewide_alert').then((response) => {
expect(response.status).to.eq(200)
})
})
Expand Down
Loading

0 comments on commit 97fda40

Please sign in to comment.