From 81997c8e3e20c53d32f68bef1298e827a5c9afd6 Mon Sep 17 00:00:00 2001 From: Shaun Drong Date: Wed, 24 Jun 2026 11:08:47 -0700 Subject: [PATCH 1/3] Add re-import commands for local Drupal changes Added commands to re-import local Drupal changes after clearing the database. --- local/etc/uceap.d/devcontainer_reset_db.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local/etc/uceap.d/devcontainer_reset_db.sh b/local/etc/uceap.d/devcontainer_reset_db.sh index ef1b5bc..c5459b5 100644 --- a/local/etc/uceap.d/devcontainer_reset_db.sh +++ b/local/etc/uceap.d/devcontainer_reset_db.sh @@ -61,6 +61,11 @@ function devcontainer_reset_db() { _cwd_workspace drush cache-rebuild + echo "Re-import local Drupal changes..." + _cwd_workspace + drush updb + drush cim -y + echo "Database reset complete!" } From b7fad62bdfdb13b608122d657c23b4d1fb863dca Mon Sep 17 00:00:00 2001 From: Shaun Drong Date: Wed, 24 Jun 2026 19:38:59 -0700 Subject: [PATCH 2/3] Update local/etc/uceap.d/devcontainer_reset_db.sh Co-authored-by: Brandt Kurowski --- local/etc/uceap.d/devcontainer_reset_db.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/local/etc/uceap.d/devcontainer_reset_db.sh b/local/etc/uceap.d/devcontainer_reset_db.sh index c5459b5..dede785 100644 --- a/local/etc/uceap.d/devcontainer_reset_db.sh +++ b/local/etc/uceap.d/devcontainer_reset_db.sh @@ -63,8 +63,7 @@ function devcontainer_reset_db() { echo "Re-import local Drupal changes..." _cwd_workspace - drush updb - drush cim -y + drush deploy echo "Database reset complete!" } From 4fa637241df0dd5b29fb10d112dd631f0842111b Mon Sep 17 00:00:00 2001 From: Shaun Drong Date: Thu, 25 Jun 2026 12:31:35 -0700 Subject: [PATCH 3/3] Implement skip-deploy option in reset_db script Added option to skip deployment during database reset. --- local/etc/uceap.d/devcontainer_reset_db.sh | 27 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/local/etc/uceap.d/devcontainer_reset_db.sh b/local/etc/uceap.d/devcontainer_reset_db.sh index dede785..56192d1 100644 --- a/local/etc/uceap.d/devcontainer_reset_db.sh +++ b/local/etc/uceap.d/devcontainer_reset_db.sh @@ -2,6 +2,23 @@ function devcontainer_reset_db() { # Detect the compose project by inspecting the current container CURRENT_CONTAINER=$(hostname) echo "Running from container: $CURRENT_CONTAINER" + local skip_deploy=false + + # Loop through all arguments passed to the function + while [[ $# -gt 0 ]]; do + case "$1" in + -sd|--skip-deploy) + skip_deploy=true + return 0 + ;; + *) + echo "Unknown option: $1" >&2 + return 1 + ;; + case_end + esac + done + # Get the compose project name from the current container's labels COMPOSE_PROJECT=$(docker inspect "$CURRENT_CONTAINER" --format '{{index .Config.Labels "com.docker.compose.project"}}' 2>/dev/null) @@ -61,10 +78,12 @@ function devcontainer_reset_db() { _cwd_workspace drush cache-rebuild - echo "Re-import local Drupal changes..." - _cwd_workspace - drush deploy - + # Check if skip-deploy not passed as option and run deploy + if [ "$skip_deploy" = false ]; then + echo "Re-import local Drupal changes..." + _cwd_workspace + drush deploy + fi echo "Database reset complete!" }