Skip to content

Commit

Permalink
PE-16 Add westy build to lando config + ignore built assets (#409)
Browse files Browse the repository at this point in the history
* PE-16 Add westy build to lando config + ignore built assets

* PE-16 Add theme build to Circle CI config

* PE-16 Build theme after Radix is installed

* PE-16 Fix typo

* PE-16 Add theme build to lando refresh
  • Loading branch information
odensc authored Nov 2, 2022
1 parent 4b6f418 commit deab1cd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 180 deletions.
13 changes: 8 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ build_and_deploy: &build_and_deploy
- ./web/profiles/contrib
- ./web/themes/contrib
- ./web/libraries
- run:
name: Build theme
command: |
cd web/themes/custom/westy && npm run production
- run:
name: Deploy to Pantheon
when: on_success
Expand All @@ -84,7 +88,7 @@ build_and_deploy: &build_and_deploy
echo "Host *.drush.in" > ~/.ssh/config
echo " HostkeyAlgorithms +ssh-rsa" >> ~/.ssh/config
echo " PubkeyAcceptedAlgorithms +ssh-rsa" >> ~/.ssh/config
# Add terminus into path
export PATH=/tmp/vendor/bin:/var/www/html/vendor/bin:$PATH && cd /var/www/html
Expand All @@ -110,7 +114,7 @@ build_and_deploy: &build_and_deploy
find ./web/themes -name .git -type d -prune -exec rm -rf "{}" \;
rm -r ./web/themes/custom/westy/node_modules/
git add -f /var/www/html
# Pantheon site will use the wrong DB if the local is kept
git rm --cache web/sites/default/settings.local.php --ignore-unmatch
git rm -r --cache web/sites/default/files --ignore-unmatch
Expand Down Expand Up @@ -289,7 +293,7 @@ visual_regression: &visual_regression
echo "Host *.drush.in" > ~/.ssh/config
echo " HostkeyAlgorithms +ssh-rsa" >> ~/.ssh/config
echo " PubkeyAcceptedAlgorithms +ssh-rsa" >> ~/.ssh/config
export PATH=/var/www/html/tests/vendor/bin:/tmp/vendor/pantheon-systems/terminus/bin:$PATH
# Log in via terminus first. Required for tests that require user login.
Expand All @@ -312,12 +316,11 @@ visual_regression: &visual_regression
path: /home/circleci/artifacts
destination: /


# Declare all of the jobs we should run.
version: 2.1
jobs:
deploy:
<<: *build_and_deploy
<<: *build_and_deploy
visual_regression:
<<: *visual_regression

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ web/libraries/
web/modules/contrib/
web/profiles/contrib/
web/themes/contrib/
web/themes/custom/westy/assets/css
web/themes/custom/westy/assets/js
web/vendor/

# Avoid accidental modification of pantheon.upstream.yml in sites
Expand Down Expand Up @@ -146,4 +148,4 @@ php.ini
/index.php
/robots.txt
/update.php
/web.config
/web.config
25 changes: 15 additions & 10 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ services:
- /bin/sh -c "adduser www-data node"
- /bin/sh -c "chmod -R 775 /var/www"
build:
- echo "Installing Node.js dependencies..."
- echo "Installing Node.js dependencies and building theme..."
- npm -C /app/web/themes/custom/westy install
- npm -C /app/web/themes/custom/westy run production
solr:
type: solr:8
portforward: true
Expand Down Expand Up @@ -94,11 +95,11 @@ tooling:
- appserver: terminus backup:get employees.dev --element=database --to=/app/artifacts/database.tar.gz
- appserver: echo "Importing database..."
- database: /helpers/sql-import.sh artifacts/database.tar.gz
# - appserver: echo "Sanitizing database..."
# - appserver: drush sql-query "drop temporary table if exists to_update; create temporary table to_update select distinct uid, name from users_field_data U left outer join user__roles R on U.uid = R.entity_id where R.roles_target_id is null or 'administrator' not in (select roles_target_id from users_field_data U2 left outer join user__roles R2 on U2.uid = R2.entity_id where U2.name = U.name); update users_field_data U inner join to_update UP on U.uid = UP.uid set U.pass = '', U.mail = concat('user+', UP.uid, '@localhost.localdomain'), U.init = concat('user+', UP.uid, '@localhost.localdomain') where UP.name <> 'Oliver Outsider' and UP.name <> 'Marty Member' and UP.name <> 'Ally Admin'; drop temporary table to_update;"
# - appserver: echo "Truncating webforms and logs..."
# - appserver: drush sql-query "truncate table webform_submission; truncate table webform_submission_data; truncate table webform_submission_log;"
# - appserver: drush sql-query "truncate table watchdog;"
# - appserver: echo "Sanitizing database..."
# - appserver: drush sql-query "drop temporary table if exists to_update; create temporary table to_update select distinct uid, name from users_field_data U left outer join user__roles R on U.uid = R.entity_id where R.roles_target_id is null or 'administrator' not in (select roles_target_id from users_field_data U2 left outer join user__roles R2 on U2.uid = R2.entity_id where U2.name = U.name); update users_field_data U inner join to_update UP on U.uid = UP.uid set U.pass = '', U.mail = concat('user+', UP.uid, '@localhost.localdomain'), U.init = concat('user+', UP.uid, '@localhost.localdomain') where UP.name <> 'Oliver Outsider' and UP.name <> 'Marty Member' and UP.name <> 'Ally Admin'; drop temporary table to_update;"
# - appserver: echo "Truncating webforms and logs..."
# - appserver: drush sql-query "truncate table webform_submission; truncate table webform_submission_data; truncate table webform_submission_log;"
# - appserver: drush sql-query "truncate table watchdog;"
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
refresh:
Expand All @@ -123,9 +124,13 @@ tooling:
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
- appserver: date +"%T"
- appserver: echo "=====Timestamp===== Drupal Config Refresh Done"
- appserver: echo "=====Timestamp===== Drupal Config Refresh Done, Starting Theme Rebuild"
- appserver: date +"%T"
# TODO: [POWR-3430] Add theme build to employees .lando.yml
- node: echo "Building theme asset files..."
- node: npm -C /app/web/themes/custom/westy install
- node: npm -C /app/web/themes/custom/westy run production
- node: echo "=====Timestamp===== Theme Rebuild Done"
- node: date +"%T"
cupex:
description: Composer update, database update, and config export to get a clean module or theme update
cmd:
Expand Down Expand Up @@ -157,9 +162,9 @@ tooling:
reindex:
description: CUSTOM Reindex the Solr searcher
service: appserver
cmd:
cmd:
- echo "Reindexing the Solr server... (this might take several minutes; use 'lando reindex &' to run the command in the background)"
- drush --root=/app/web search-api:reset-tracker
- drush --root=/app/web search-api:reset-tracker
- drush --root=/app/web search-api:index > /dev/null 2>&1
- echo "Done reindexing the Solr server."
update-core:
Expand Down
1 change: 0 additions & 1 deletion web/themes/custom/westy/assets/css/westy.style.css

This file was deleted.

2 changes: 0 additions & 2 deletions web/themes/custom/westy/assets/js/westy.script.js

This file was deleted.

161 changes: 0 additions & 161 deletions web/themes/custom/westy/assets/js/westy.script.js.LICENSE.txt

This file was deleted.

0 comments on commit deab1cd

Please sign in to comment.