Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vortex/docs/.utils/update-installer-video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ INSTALLER_BUILD="${PROJECT_ROOT}/.vortex/installer/build/installer.phar"
INSTALLER_SOURCE_DIR="${PROJECT_ROOT}/.vortex/installer"

# Logging functions
note() { printf " %s\n" "${1}"; }
info() { echo -e "\033[0;34m[INFO]\033[0m $1" >&2; }
note() { printf " %s\n" "${1}"; }
pass() { echo -e "\033[0;32m[ OK ]\033[0m $1" >&2; }
fail() { echo -e "\033[0;31m[FAIL]\033[0m $1" >&2; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ VORTEX_EXAMPLE_URL="${VORTEX_EXAMPLE_URL:-http://example.com}"
# ------------------------------------------------------------------------------

# @formatter:off
note() { printf " %s\n" "${1}"; }
info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; }
fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; }
# @formatter:on
Expand Down
2 changes: 1 addition & 1 deletion .vortex/docs/content/drupal/provision-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ set -eu
# ------------------------------------------------------------------------------

info() { printf " ==> %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }

drush() { ./vendor/bin/drush -y "$@"; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ set -eu
# ------------------------------------------------------------------------------

info() { printf " ==> %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
pass() { printf " < %s\n" "${1}"; }
fail() { printf " ! %s\n" "${1}"; }

drush() { ./vendor/bin/drush -y "$@"; }

Expand All @@ -36,19 +38,24 @@ if echo "${environment}" | grep -q -e dev -e stage -e ci -e local; then

task "Setting site name."
drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();"
pass "Set site name."

task "Installing contrib modules."
drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect reroute_email robotstxt shield stage_file_proxy xmlsitemap
pass "Installed contrib modules."

task "Installing Redis module."
drush pm:install redis || true
pass "Installed Redis module."

task "Installing and configuring ClamAV."
drush pm:install clamav
drush config-set clamav.settings mode_daemon_tcpip.hostname clamav
pass "Installed and configured ClamAV."

task "Installing Solr search modules."
drush pm:install search_api search_api_solr
pass "Installed Solr search modules."

# Enable custom site module and run its deployment hooks.
#
Expand All @@ -60,9 +67,11 @@ if echo "${environment}" | grep -q -e dev -e stage -e ci -e local; then
drush pm:install sw_search

drush pm:install sw_demo
pass "Installed custom site modules."

task "Running deployment hooks."
drush deploy:hook
pass "Ran deployment hooks."

# Conditionally perform an action if this is a "fresh" database.
if [ "${VORTEX_PROVISION_OVERRIDE_DB:-0}" = "1" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@@ -55,7 +55,6 @@
@@ -62,7 +62,6 @@
# Note that deployment hooks for already enabled modules have run in the
# parent "provision.sh" script.
task "Installing custom site modules."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
@@ -59,8 +59,6 @@
@@ -66,7 +66,6 @@

drush pm:install sw_search

- drush pm:install sw_demo
-
task "Running deployment hooks."
drush deploy:hook
pass "Installed custom site modules."

task "Running deployment hooks."
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@@ -57,8 +57,6 @@
@@ -64,8 +64,6 @@
task "Installing custom site modules."
drush pm:install sw_base

- drush pm:install sw_search
-
drush pm:install sw_demo
pass "Installed custom site modules."

task "Running deployment hooks."
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@@ -55,11 +55,6 @@
@@ -62,11 +62,7 @@
# Note that deployment hooks for already enabled modules have run in the
# parent "provision.sh" script.
task "Installing custom site modules."
- drush pm:install sw_base
-
- drush pm:install sw_search
-
- drush pm:install sw_demo
pass "Installed custom site modules."

task "Running deployment hooks."
drush deploy:hook
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
@@ -47,9 +47,6 @@
drush pm:install clamav
@@ -53,10 +53,6 @@
drush config-set clamav.settings mode_daemon_tcpip.hostname clamav
pass "Installed and configured ClamAV."

- task "Installing Solr search modules."
- drush pm:install search_api search_api_solr
- pass "Installed Solr search modules."
-
# Enable custom site module and run its deployment hooks.
#
# Note that deployment hooks for already enabled modules have run in the
@@ -56,8 +53,6 @@
@@ -63,8 +59,6 @@
# parent "provision.sh" script.
task "Installing custom site modules."
drush pm:install sw_base
-
- drush pm:install sw_search

drush pm:install sw_demo

pass "Installed custom site modules."
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ VORTEX_DOWNLOAD_DB2_FILE="${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}"
# ------------------------------------------------------------------------------

# @formatter:off
info() { printf " ==> %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; }
info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[36m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; }
pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; }
fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
pass() { printf " < %s\n" "${1}"; }
fail() { printf " ! %s\n" "${1}"; }
# @formatter:on

drush() { ./vendor/bin/drush -y "$@"; }
Expand Down Expand Up @@ -104,13 +104,17 @@ run_migration() {
drush migrate:messages "${migration_name}"
exit 1
}

pass "Migrated: ${migration_name}."
}

# Detect if existing migration source database is corrupted.
if [ "${DRUPAL_MIGRATION_SOURCE_DB_IMPORT}" != "1" ]; then
note "Source database import is set to be skipped. Checking existing database."
task "Probing for '${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}' table in the source database."
if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
if drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
pass "Source database is intact."
else
note "Migration source database is corrupted or empty. Re-importing."
DRUPAL_MIGRATION_SOURCE_DB_IMPORT=1
fi
Expand All @@ -137,18 +141,21 @@ if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION
drush sql:query --database=migrate "SHOW TABLES;"
exit 1
fi
pass "Verified migration source database."

# Enable custom migration modules.
task "Enabling migration modules."
drush pm:install ys_migrate
pass "Enabled migration modules."

task "Starting migrations."
info "Starting migrations."

if [ "${DRUPAL_MIGRATION_ROLLBACK_SKIP}" = "1" ]; then
note "Skipping rollback of all migrations."
else
task "Rolling back all migrations."
drush migrate:rollback --all || true
pass "Rolled back all migrations."
fi
echo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ VORTEX_DOWNLOAD_DB2_FILE="${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}"
# ------------------------------------------------------------------------------

# @formatter:off
info() { printf " ==> %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; }
info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[36m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; }
pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; }
fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
pass() { printf " < %s\n" "${1}"; }
fail() { printf " ! %s\n" "${1}"; }
# @formatter:on

drush() { ./vendor/bin/drush -y "$@"; }
Expand Down Expand Up @@ -104,13 +104,17 @@ run_migration() {
drush migrate:messages "${migration_name}"
exit 1
}

pass "Migrated: ${migration_name}."
}

# Detect if existing migration source database is corrupted.
if [ "${DRUPAL_MIGRATION_SOURCE_DB_IMPORT}" != "1" ]; then
note "Source database import is set to be skipped. Checking existing database."
task "Probing for '${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}' table in the source database."
if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
if drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
pass "Source database is intact."
else
note "Migration source database is corrupted or empty. Re-importing."
DRUPAL_MIGRATION_SOURCE_DB_IMPORT=1
fi
Expand All @@ -137,18 +141,21 @@ if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION
drush sql:query --database=migrate "SHOW TABLES;"
exit 1
fi
pass "Verified migration source database."

# Enable custom migration modules.
task "Enabling migration modules."
drush pm:install ys_migrate
pass "Enabled migration modules."

task "Starting migrations."
info "Starting migrations."

if [ "${DRUPAL_MIGRATION_ROLLBACK_SKIP}" = "1" ]; then
note "Skipping rollback of all migrations."
else
task "Rolling back all migrations."
drush migrate:rollback --all || true
pass "Rolled back all migrations."
fi
echo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ VORTEX_DOWNLOAD_DB2_FILE="${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}"
# ------------------------------------------------------------------------------

# @formatter:off
info() { printf " ==> %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; }
info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[36m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; }
pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; }
fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
pass() { printf " < %s\n" "${1}"; }
fail() { printf " ! %s\n" "${1}"; }
# @formatter:on

drush() { ./vendor/bin/drush -y "$@"; }
Expand Down Expand Up @@ -104,13 +104,17 @@ run_migration() {
drush migrate:messages "${migration_name}"
exit 1
}

pass "Migrated: ${migration_name}."
}

# Detect if existing migration source database is corrupted.
if [ "${DRUPAL_MIGRATION_SOURCE_DB_IMPORT}" != "1" ]; then
note "Source database import is set to be skipped. Checking existing database."
task "Probing for '${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}' table in the source database."
if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
if drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
pass "Source database is intact."
else
note "Migration source database is corrupted or empty. Re-importing."
DRUPAL_MIGRATION_SOURCE_DB_IMPORT=1
fi
Expand All @@ -137,18 +141,21 @@ if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION
drush sql:query --database=migrate "SHOW TABLES;"
exit 1
fi
pass "Verified migration source database."

# Enable custom migration modules.
task "Enabling migration modules."
drush pm:install ys_migrate
pass "Enabled migration modules."

task "Starting migrations."
info "Starting migrations."

if [ "${DRUPAL_MIGRATION_ROLLBACK_SKIP}" = "1" ]; then
note "Skipping rollback of all migrations."
else
task "Rolling back all migrations."
drush migrate:rollback --all || true
pass "Rolled back all migrations."
fi
echo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ VORTEX_DOWNLOAD_DB2_FILE="${VORTEX_DOWNLOAD_DB2_FILE:-db2.sql}"
# ------------------------------------------------------------------------------

# @formatter:off
info() { printf " ==> %s\n" "${1}"; }
note() { printf " %s\n" "${1}"; }
task() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; }
info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[36m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %s\n" "${1}"; }
pass() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s\033[0m\n" "${1}" || printf "[ OK ] %s\n" "${1}"; }
fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; }
task() { printf " > %s\n" "${1}"; }
pass() { printf " < %s\n" "${1}"; }
fail() { printf " ! %s\n" "${1}"; }
# @formatter:on

drush() { ./vendor/bin/drush -y "$@"; }
Expand Down Expand Up @@ -104,13 +104,17 @@ run_migration() {
drush migrate:messages "${migration_name}"
exit 1
}

pass "Migrated: ${migration_name}."
}

# Detect if existing migration source database is corrupted.
if [ "${DRUPAL_MIGRATION_SOURCE_DB_IMPORT}" != "1" ]; then
note "Source database import is set to be skipped. Checking existing database."
task "Probing for '${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}' table in the source database."
if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
if drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION_SOURCE_DB_PROBE_TABLE}" >/dev/null 2>&1; then
pass "Source database is intact."
else
note "Migration source database is corrupted or empty. Re-importing."
DRUPAL_MIGRATION_SOURCE_DB_IMPORT=1
fi
Expand All @@ -137,18 +141,21 @@ if ! drush sql:query --database=migrate "SELECT COUNT(*) FROM ${DRUPAL_MIGRATION
drush sql:query --database=migrate "SHOW TABLES;"
exit 1
fi
pass "Verified migration source database."

# Enable custom migration modules.
task "Enabling migration modules."
drush pm:install ys_migrate
pass "Enabled migration modules."

task "Starting migrations."
info "Starting migrations."

if [ "${DRUPAL_MIGRATION_ROLLBACK_SKIP}" = "1" ]; then
note "Skipping rollback of all migrations."
else
task "Rolling back all migrations."
drush migrate:rollback --all || true
pass "Rolled back all migrations."
fi
echo

Expand Down
Loading
Loading