Skip to content

Commit

Permalink
Updated SKIP* variables.
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Skrypnyk <alex@drevops.com>
  • Loading branch information
AlexSkrypnyk committed Jul 16, 2023
1 parent 4c73730 commit 4866b15
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 52 deletions.
14 changes: 8 additions & 6 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ commands:
-e DREVOPS_DRUPAL_INSTALL_OPERATIONS_SKIP=${DREVOPS_DRUPAL_INSTALL_OPERATIONS_SKIP:-} \
-e DREVOPS_DRUPAL_INSTALL_OVERRIDE_EXISTING_DB=${DREVOPS_DRUPAL_INSTALL_OVERRIDE_EXISTING_DB:-0} \
-e DREVOPS_DRUPAL_PROFILE=${DREVOPS_DRUPAL_PROFILE:-standard} \
-e CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=${CIVICTHEME_SKIP_SUBTHEME_ACTIVATION:-0} \
-e CIVICTHEME_SKIP_SUBTHEME_FE=${CIVICTHEME_SKIP_SUBTHEME_FE:-} \
-e CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE=${CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE:-} \
-e CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=${CIVICTHEME_SUBTHEME_ACTIVATION_SKIP:-0} \
-e CIVICTHEME_SUBTHEME_FE_SKIP=${CIVICTHEME_SUBTHEME_FE_SKIP:-} \
-e CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=${CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP:-} \
-e CIVICTHEME_CONTENT_PROFILE=${CIVICTHEME_CONTENT_PROFILE:-} \
-T cli ./scripts/drevops/drupal-install-site.sh
Expand Down Expand Up @@ -151,13 +151,13 @@ commands:
fei:
usage: Install front-end assets.
cmd: |
[ "${CIVICTHEME_SKIP_LIBRARY_INSTALL}" != "1" ] && ahoy cli "npm --prefix docroot/themes/contrib/${DREVOPS_DRUPAL_THEME}/civictheme_library install"
[ "${CIVICTHEME_LIBRARY_INSTALL_SKIP}" != "1" ] && ahoy cli "npm --prefix docroot/themes/contrib/${DREVOPS_DRUPAL_THEME}/civictheme_library install"
ahoy cli "npm --prefix docroot/themes/contrib/${DREVOPS_DRUPAL_THEME} install"
fe:
usage: Build front-end assets.
cmd: |
[ "${CIVICTHEME_SKIP_LIBRARY_INSTALL}" != "1" ] && ahoy cli "cd docroot/themes/contrib/${DREVOPS_DRUPAL_THEME}/civictheme_library && npm run build"
[ "${CIVICTHEME_LIBRARY_INSTALL_SKIP}" != "1" ] && ahoy cli "cd docroot/themes/contrib/${DREVOPS_DRUPAL_THEME}/civictheme_library && npm run build"
ahoy cli "cd docroot/themes/contrib/${DREVOPS_DRUPAL_THEME} && npm run build"
lint:
Expand Down Expand Up @@ -214,7 +214,9 @@ commands:
cmd: |
ahoy cli "./scripts/update-theme-config.sh"
ahoy drush cde civictheme_dev || true
ahoy drush cde cs_generated_content || true
if ahoy drush pm:list --status=Enabled --field=name | grep -q 'cs_generated_content'; then
ahoy drush cde cs_generated_content || true
fi
export-content:
usage: Export content (run with CIVICTHEME_CONTENT_PROFILE=corporate ahoy install-site) .
Expand Down
29 changes: 15 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ aliases:
sed -i -e "/###/d" docker-compose.yml && sed -i -e "s/##//" docker-compose.yml
# Alter build for an alternative build setup.
if [ "$CIVICTHEME_INSTALL_SIBLING" = "1" ]; then cp -f .docker/Dockerfile.cli.sibling .docker/Dockerfile.cli; fi
if [ "$CIVICTHEME_SKIP_LIBRARY_INSTALL" = "1" ]; then cp -f .docker/Dockerfile.cli.onlytheme .docker/Dockerfile.cli; fi
if [ "$CIVICTHEME_LIBRARY_INSTALL_SKIP" = "1" ]; then cp -f .docker/Dockerfile.cli.onlytheme .docker/Dockerfile.cli; fi
################################################################################
# JOBS
Expand Down Expand Up @@ -206,8 +206,7 @@ job-build-no-persist: &job-build-no-persist
command: ahoy lint
- run:
name: Lint theme config
# Drupal 10 has different configuration export logic which results in config differences.
command: '[ "$DREVOPS_DRUPAL_VERSION" == "10" ] && (ahoy lint config || true) || ahoy lint config'
command: ahoy lint config
- run:
name: Run tooling tests
command: ./scripts/test-tooling.sh
Expand Down Expand Up @@ -265,6 +264,7 @@ jobs:
environment:
DREVOPS_DRUPAL_PROFILE: minimal
DREVOPS_TEST_BEHAT_TAGS: smoke
DREVOPS_LINT_CONFIG_ALLOW_FAILURE: 1
<<: *job-build-no-persist

# Drupal 9, minimal profile, 'corporate' content profile.
Expand All @@ -273,8 +273,8 @@ jobs:
environment:
DREVOPS_DRUPAL_PROFILE: minimal
CIVICTHEME_CONTENT_PROFILE: corporate
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION: 1
CIVICTHEME_SKIP_LIBRARY_INSTALL: 1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP: 1
CIVICTHEME_LIBRARY_INSTALL_SKIP: 1
DREVOPS_TEST_BEHAT_TAGS: smoke
<<: *job-build-no-persist

Expand All @@ -284,8 +284,8 @@ jobs:
environment:
DREVOPS_DRUPAL_PROFILE: minimal
CIVICTHEME_CONTENT_PROFILE: highereducation
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION: 1
CIVICTHEME_SKIP_LIBRARY_INSTALL: 1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP: 1
CIVICTHEME_LIBRARY_INSTALL_SKIP: 1
DREVOPS_TEST_BEHAT_TAGS: smoke
<<: *job-build-no-persist

Expand All @@ -295,8 +295,8 @@ jobs:
environment:
DREVOPS_DRUPAL_PROFILE: minimal
CIVICTHEME_CONTENT_PROFILE: government
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION: 1
CIVICTHEME_SKIP_LIBRARY_INSTALL: 1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP: 1
CIVICTHEME_LIBRARY_INSTALL_SKIP: 1
DREVOPS_TEST_BEHAT_TAGS: smoke
<<: *job-build-no-persist

Expand All @@ -322,8 +322,8 @@ jobs:
<<: *container_config
environment:
DREVOPS_DRUPAL_PROFILE: govcms
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION: 1
CIVICTHEME_SKIP_LIBRARY_INSTALL: 1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP: 1
CIVICTHEME_LIBRARY_INSTALL_SKIP: 1
<<: *job-build

# Drupal 10, minimal profile.
Expand All @@ -333,6 +333,7 @@ jobs:
DREVOPS_DRUPAL_PROFILE: minimal
DREVOPS_DRUPAL_VERSION: 10
DREVOPS_TEST_BEHAT_TAGS: smoke
DREVOPS_LINT_CONFIG_ALLOW_FAILURE: 1
<<: *job-build-no-persist

# Drupal 10, minimal profile, no subtheme.
Expand All @@ -341,9 +342,9 @@ jobs:
environment:
DREVOPS_DRUPAL_PROFILE: minimal
DREVOPS_DRUPAL_VERSION: 10
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION: 1
CIVICTHEME_SKIP_LIBRARY_INSTALL: 1
DREVOPS_TEST_FUNCTIONAL_GROUP: site:functional,civictheme:functional:update
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP: 1
CIVICTHEME_LIBRARY_INSTALL_SKIP: 1
DREVOPS_LINT_CONFIG_ALLOW_FAILURE: 1
<<: *job-build-no-persist

# Mirror and redeploy content profiles.
Expand Down
6 changes: 3 additions & 3 deletions .lagoon.env.content-corporate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CIVICTHEME_CONTENT_PROFILE=corporate
CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE=1
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1
CIVICTHEME_SKIP_LIBRARY_INSTALL=1
CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1
CIVICTHEME_LIBRARY_INSTALL_SKIP=1
6 changes: 3 additions & 3 deletions .lagoon.env.content-government
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CIVICTHEME_CONTENT_PROFILE=government
CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE=1
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1
CIVICTHEME_SKIP_LIBRARY_INSTALL=1
CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1
CIVICTHEME_LIBRARY_INSTALL_SKIP=1
6 changes: 3 additions & 3 deletions .lagoon.env.content-highereducation
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CIVICTHEME_CONTENT_PROFILE=highereducation
CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE=1
CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1
CIVICTHEME_SKIP_LIBRARY_INSTALL=1
CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1
CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1
CIVICTHEME_LIBRARY_INSTALL_SKIP=1
6 changes: 3 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Note that wildcards are supported.
export CIVICTHEME_CONTENT_PROFILE=default

# Prepare content with a clean installation.
DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1 CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE=1 ahoy install-site
DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1 CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP=1 ahoy install-site

# Export content.
ahoy export-content
Expand All @@ -72,11 +72,11 @@ Note that wildcards are supported.
1. Checkout this repository at the specific release
2. Update bare database dump:
```
DREVOPS_DRUPAL_VERSION=10 DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1 CIVICTHEME_SKIP_LIBRARY_INSTALL=1 SKIP_GENERATED_CONTENT_CREATE=1 ahoy build
DREVOPS_DRUPAL_VERSION=10 DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1 CIVICTHEME_LIBRARY_INSTALL_SKIP=1 SKIP_GENERATED_CONTENT_CREATE=1 ahoy build
ahoy cli php docroot/core/scripts/dump-database-d8-mysql.php | gzip > docroot/themes/contrib/civictheme/tests/fixtures/updates/drupal_<Drupal-Version>.minimal.civictheme_<CivicTheme-Version>.bare.php.gz
```
3. Update filled database dump:
```
DREVOPS_DRUPAL_VERSION=10 DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SKIP_SUBTHEME_ACTIVATION=1 CIVICTHEME_SKIP_LIBRARY_INSTALL=1 ahoy build
DREVOPS_DRUPAL_VERSION=10 DREVOPS_DRUPAL_PROFILE=minimal CIVICTHEME_SUBTHEME_ACTIVATION_SKIP=1 CIVICTHEME_LIBRARY_INSTALL_SKIP=1 ahoy build
ahoy cli php docroot/core/scripts/dump-database-d8-mysql.php | gzip > docroot/themes/contrib/civictheme/tests/fixtures/updates/drupal_<Drupal-Version>.minimal.civictheme_<CivicTheme-Version>.filled.php.gz
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- field.field.node.civictheme_alert.field_c_n_date_range
- node.type.civictheme_alert
module:
- content_moderation
- datetime_range
- path
- text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- field.field.node.civictheme_event.field_c_n_vertical_spacing
- node.type.civictheme_event
module:
- content_moderation
- datetime
- datetime_range
- field_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies:
- field.field.node.civictheme_page.field_c_n_vertical_spacing
- node.type.civictheme_page
module:
- content_moderation
- datetime
- field_group
- media_library
Expand Down
4 changes: 2 additions & 2 deletions scripts/custom/drupal-install-site-2-activate-subtheme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ APP="${APP:-/app}"

# ------------------------------------------------------------------------------

[ "${CIVICTHEME_SKIP_SUBTHEME_ACTIVATION}" = "1" ] && echo "Skipping sub-theme activation" && return
[ "${CIVICTHEME_SUBTHEME_ACTIVATION_SKIP}" = "1" ] && echo "Skipping sub-theme activation" && return

# Use local or global Drush, giving priority to a local drush.
drush="$(if [ -f "${APP}/vendor/bin/drush" ]; then echo "${APP}/vendor/bin/drush"; else command -v drush; fi)"
Expand All @@ -30,7 +30,7 @@ $drush theme:enable civictheme_demo -y
echo " > Setting civictheme_demo as a default theme."
$drush config-set system.theme default civictheme_demo -y

if [ "$CIVICTHEME_SKIP_SUBTHEME_FE" != "1" ] && command -v npm &> /dev/null; then
if [ "$CIVICTHEME_SUBTHEME_FE_SKIP" != "1" ] && command -v npm &> /dev/null; then
pushd $APP/docroot/themes/custom/civictheme_demo >/dev/null || exit 1

if [ ! -d $APP/docroot/themes/custom/civictheme_demo/node_modules ]; then
Expand Down
28 changes: 28 additions & 0 deletions scripts/custom/drupal-install-site-3-enable-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
##
# Enable other modules.
#
# shellcheck disable=SC2086

set -e
[ -n "${DREVOPS_DEBUG}" ] && set -x

# Path to the application.
APP="${APP:-/app}"

# ------------------------------------------------------------------------------

# Use local or global Drush, giving priority to a local drush.
drush="$(if [ -f "${APP}/vendor/bin/drush" ]; then echo "${APP}/vendor/bin/drush"; else command -v drush; fi)"

if [ "${DREVOPS_DRUPAL_PROFILE}" = "govcms" ]; then
echo " > Remove GovCMS configs."
$drush -y pm-enable civictheme_govcms
$drush civictheme_govcms:remove-config
else
echo " > Enable Admin module."
$drush -y pm-enable civictheme_admin
fi

echo " > Enable development module."
$drush -y pm-enable civictheme_dev
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ APP="${APP:-/app}"
# Use local or global Drush, giving priority to a local drush.
drush="$(if [ -f "${APP}/vendor/bin/drush" ]; then echo "${APP}/vendor/bin/drush"; else command -v drush; fi)"

if [ "${DREVOPS_DRUPAL_PROFILE}" = "govcms" ]; then
echo " > Remove GovCMS configs."
$drush -y pm-enable civictheme_govcms
$drush civictheme_govcms:remove-config
else
echo " > Enable Admin module."
$drush -y pm-enable civictheme_admin
fi

if [ -n "${CIVICTHEME_CONTENT_PROFILE}" ]; then
echo " > Provisioning content from \"${CIVICTHEME_CONTENT_PROFILE}\" content profile."
$drush -y pm-enable civictheme_content
Expand All @@ -32,11 +23,7 @@ else
$drush php:eval -v "require_once '/app/docroot/themes/contrib/civictheme/theme-settings.provision.inc'; civictheme_provision_cli();"
fi

echo " > Enable development module."
$drush -y pm-enable civictheme_dev

if [ "${CIVICTHEME_SKIP_GENERATED_CONTENT_CREATE}" != "1" ]; then

if [ "${CIVICTHEME_GENERATED_CONTENT_CREATE_SKIP}" != "1" ]; then
echo " > Generate test content."
GENERATED_CONTENT_CREATE=1 $drush -y pm-enable cs_generated_content

Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy-code-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
# Deploy code release.
#
# Mirror code repository releases to another repository with logs created from
# Push code repository releases to another repository with logs created from
# the commits between release tags.
#
# Optionally, select which subdirectory in the source repository is copied to
Expand Down
2 changes: 1 addition & 1 deletion scripts/drevops/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fi
# Lint theme configuration.
if [ -z "${DREVOPS_LINT_TYPE##*config*}" ]; then
# Lint theme configuration.
./scripts/lint-theme-config.sh
./scripts/lint-theme-config.sh || [ "${DREVOPS_LINT_CONFIG_ALLOW_FAILURE:-0}" -eq 1 ]

# Lint theme schema.
./vendor/bin/drush inspect_config civictheme.settings --detail --only-error
Expand Down
4 changes: 2 additions & 2 deletions scripts/test-tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ bats tests/bats/mock.bats --tap
echo "==> Test Assets mock."
bats tests/bats/assets.bats --tap

if [ "${CIVICTHEME_SKIP_LIBRARY_INSTALL}" != "1" ]; then
if [ "${CIVICTHEME_LIBRARY_INSTALL_SKIP}" != "1" ]; then
echo " > Test Library assets."
bats tests/bats/assets_library.bats --tap
fi

echo " > Test theme assets."
bats tests/bats/assets.bats --tap

if [ "${CIVICTHEME_SKIP_SUBTHEME_ACTIVATION}" != "1" ]; then
if [ "${CIVICTHEME_SUBTHEME_ACTIVATION_SKIP}" != "1" ]; then
if [ "${CIVICTHEME_INSTALL_SIBLING}" = "1" ]; then
echo " > Test Sub-theme sibling assets."
bats tests/bats/assets_demo_sibling.bats --tap
Expand Down
5 changes: 5 additions & 0 deletions scripts/theme_excluded_configs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ core.entity_view_mode.taxonomy_term.token
core.entity_view_mode.user.compact
core.entity_view_mode.user.full
core.entity_view_mode.user.token
core.entity_view_mode.webform.token
core.entity_view_mode.webform_submission.token
core.extension
core.menu.static_menu_link_overrides
dblog.settings
encrypt.settings
environment_indicator.settings
event_log_track.*
field.field.user.user.field_last_password_reset
field.field.user.user.field_password_expiration
field.field.user.user.field_pending_expire_sent
Expand Down Expand Up @@ -123,6 +126,7 @@ media.type.document*
media.type.image*
media.type.remote_video*
media.type.video*
media_file_delete.settings
media_library.settings
menu_ui.settings
node.settings
Expand All @@ -146,6 +150,7 @@ simple_sitemap.type.default_hreflang
simple_sitemap.type.index
simple_sitemap.types.*
stage_file_proxy*
syslog.settings
system.action*
system.advisories
system.authorize
Expand Down

0 comments on commit 4866b15

Please sign in to comment.