diff --git a/.vortex/docs/.utils/update-installer-video.sh b/.vortex/docs/.utils/update-installer-video.sh index 2c53126ed..d9112d398 100755 --- a/.vortex/docs/.utils/update-installer-video.sh +++ b/.vortex/docs/.utils/update-installer-video.sh @@ -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; } diff --git a/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh b/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh index 8f026be4b..7ef4ce890 100755 --- a/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh +++ b/.vortex/docs/content/contributing/maintenance/script-boilerplate.sh @@ -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 diff --git a/.vortex/docs/content/drupal/provision-example.sh b/.vortex/docs/content/drupal/provision-example.sh index 5d4d0d4d9..090dfb21c 100755 --- a/.vortex/docs/content/drupal/provision-example.sh +++ b/.vortex/docs/content/drupal/provision-example.sh @@ -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 "$@"; } diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/_baseline/scripts/custom/provision-10-example.sh index be78d7e7a..9a7b11cda 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/scripts/custom/provision-10-example.sh @@ -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 "$@"; } @@ -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. # @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_base/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_base/scripts/custom/provision-10-example.sh index fbba62577..f7fe858aa 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_base/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_base/scripts/custom/provision-10-example.sh @@ -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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/scripts/custom/provision-10-example.sh index 458f15b2b..7ac5bf0eb 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/scripts/custom/provision-10-example.sh @@ -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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_search/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_search/scripts/custom/provision-10-example.sh index 7a12a6146..48b459189 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_search/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_search/scripts/custom/provision-10-example.sh @@ -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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/scripts/custom/provision-10-example.sh index 007d8e6b9..88968deb0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/scripts/custom/provision-10-example.sh @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/scripts/custom/provision-10-example.sh index 72f8e4d2a..dbaecddf1 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/scripts/custom/provision-10-example.sh @@ -1,14 +1,15 @@ -@@ -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 @@ -16,4 +17,4 @@ - drush pm:install sw_search drush pm:install sw_demo - + pass "Installed custom site modules." diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_container_registry/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_container_registry/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_container_registry/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_container_registry/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/scripts/custom/provision-20-migration.sh b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/scripts/custom/provision-20-migration.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_admin_toolbar/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_admin_toolbar/scripts/custom/provision-10-example.sh index ae73a79b9..11a996ff2 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_admin_toolbar/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_admin_toolbar/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_coffee/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_coffee/scripts/custom/provision-10-example.sh index 5edfc36ec..153e0f165 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_coffee/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_coffee/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/scripts/custom/provision-10-example.sh index b69459967..1c23c23fa 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/scripts/custom/provision-10-example.sh index cb1da6d9f..2e48cb9e0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/scripts/custom/provision-10-example.sh index e364028ad..b9574fca1 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media pathauto redirect reroute_email robotstxt shield stage_file_proxy xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/scripts/custom/provision-10-example.sh index 9a4edad1b..d8ac969c8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator redirect reroute_email robotstxt shield stage_file_proxy xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/scripts/custom/provision-10-example.sh index 3319f534d..154bbb57f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto reroute_email robotstxt shield stage_file_proxy xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/scripts/custom/provision-10-example.sh index b539b7f82..71e0ede02 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect reroute_email shield stage_file_proxy xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/scripts/custom/provision-10-example.sh index 9d4f613fd..c0d3985ab 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect reroute_email robotstxt xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/scripts/custom/provision-10-example.sh index 3b69b1e55..29d15eee9 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect reroute_email robotstxt stage_file_proxy xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/scripts/custom/provision-10-example.sh index fc258f924..06113e960 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/scripts/custom/provision-10-example.sh @@ -1,9 +1,9 @@ -@@ -38,7 +38,7 @@ - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" +@@ -41,7 +41,7 @@ + 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 + drush pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect reroute_email robotstxt shield xmlsitemap + pass "Installed contrib modules." task "Installing Redis module." - drush pm:install redis || true diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_none/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/modules_none/scripts/custom/provision-10-example.sh index accac3172..accabc146 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_none/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_none/scripts/custom/provision-10-example.sh @@ -1,10 +1,11 @@ -@@ -37,9 +37,6 @@ - task "Setting site name." +@@ -40,10 +40,6 @@ 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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/names/scripts/custom/provision-10-example.sh index 496281d48..c20eec6b2 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/names/scripts/custom/provision-10-example.sh @@ -1,13 +1,13 @@ -@@ -35,7 +35,7 @@ +@@ -37,7 +37,7 @@ note "Running example operations in non-production environment." task "Setting site name." - drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'star wars')->save();" + drush php:eval "\Drupal::service('config.factory')->getEditable('system.site')->set('name', 'New hope')->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 -@@ -55,11 +55,11 @@ +@@ -62,11 +62,11 @@ # Note that deployment hooks for already enabled modules have run in the # parent "provision.sh" script. task "Installing custom site modules." @@ -19,6 +19,6 @@ - drush pm:install sw_demo + drush pm:install the_force_demo + pass "Installed custom site modules." task "Running deployment hooks." - drush deploy:hook diff --git a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/scripts/custom/provision-10-example.sh index c68100be9..02a15fa7d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/scripts/custom/provision-10-example.sh @@ -1,9 +1,10 @@ -@@ -40,9 +40,6 @@ - task "Installing contrib modules." +@@ -44,10 +44,6 @@ 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/scripts/custom/provision-10-example.sh index 9cb0ae6e4..493a79c34 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/scripts/custom/provision-10-example.sh @@ -1,11 +1,12 @@ -@@ -43,10 +43,6 @@ - task "Installing Redis module." +@@ -48,11 +48,6 @@ 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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_no_clamav/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/services_no_clamav/scripts/custom/provision-10-example.sh index 9cb0ae6e4..493a79c34 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_no_clamav/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/services_no_clamav/scripts/custom/provision-10-example.sh @@ -1,11 +1,12 @@ -@@ -43,10 +43,6 @@ - task "Installing Redis module." +@@ -48,11 +48,6 @@ 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." diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/scripts/custom/provision-10-example.sh index c68100be9..02a15fa7d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/services_no_redis/scripts/custom/provision-10-example.sh @@ -1,9 +1,10 @@ -@@ -40,9 +40,6 @@ - task "Installing contrib modules." +@@ -44,10 +44,6 @@ 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 diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_no_solr/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/services_no_solr/scripts/custom/provision-10-example.sh index 72f8e4d2a..dbaecddf1 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_no_solr/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/services_no_solr/scripts/custom/provision-10-example.sh @@ -1,14 +1,15 @@ -@@ -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 @@ -16,4 +17,4 @@ - drush pm:install sw_search drush pm:install sw_demo - + pass "Installed custom site modules." diff --git a/.vortex/installer/tests/Fixtures/handler_process/services_none/scripts/custom/provision-10-example.sh b/.vortex/installer/tests/Fixtures/handler_process/services_none/scripts/custom/provision-10-example.sh index 9c9daadd5..125514505 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/services_none/scripts/custom/provision-10-example.sh +++ b/.vortex/installer/tests/Fixtures/handler_process/services_none/scripts/custom/provision-10-example.sh @@ -1,21 +1,24 @@ -@@ -40,16 +40,6 @@ - task "Installing contrib modules." +@@ -44,19 +44,6 @@ 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. # # Note that deployment hooks for already enabled modules have run in the -@@ -56,8 +46,6 @@ +@@ -63,8 +50,6 @@ # parent "provision.sh" script. task "Installing custom site modules." drush pm:install sw_base @@ -23,4 +26,4 @@ - drush pm:install sw_search drush pm:install sw_demo - + pass "Installed custom site modules." diff --git a/.vortex/tests/lint.scripts.sh b/.vortex/tests/lint.scripts.sh index 9b0fe1677..8d74fcc4f 100755 --- a/.vortex/tests/lint.scripts.sh +++ b/.vortex/tests/lint.scripts.sh @@ -4,13 +4,43 @@ # # LCOV_EXCL_START -set -eu +set -euo pipefail [ "${VORTEX_DEBUG-}" = "1" ] && set -x ROOT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)")" [ ! -f "${ROOT_DIR}/.vortex/tests/vendor/bin/shellvar" ] && composer --working-dir="${ROOT_DIR}/.vortex/tests" install +# Mask out lines between '# @formatter:off' and '# @formatter:on' so that +# shfmt does not reformat helper functions that are intentionally kept on +# a single line. Each masked line is replaced with a ':' (no-op) placeholder +# indented to match the '# @formatter:off' line's own indentation, so the +# surrounding code parses as valid bash at the expected scope. +mask_protected() { + awk -v file="${1}" ' + /# @formatter:off/ { + in_block = 1 + match($0, /^[[:space:]]*/) + indent = substr($0, 1, RLENGTH) + print + next + } + /# @formatter:on/ { + in_block = 0 + print + next + } + in_block { print indent ":"; next } + { print } + END { + if (in_block) { + printf "Unclosed formatter block in %s: missing # @formatter:on\n", file > "/dev/stderr" + exit 2 + } + } + ' "${1}" +} + targets=() while IFS= read -r -d $'\0'; do targets+=("${REPLY}") @@ -37,7 +67,7 @@ for file in "${targets[@]}"; do exit 1 fi - if ! LC_ALL=C.UTF-8 shfmt -i 2 -ci -s -d "${file}"; then + if ! mask_protected "${file}" | LC_ALL=C.UTF-8 shfmt -i 2 -ci -s -d; then exit 1 fi fi diff --git a/scripts/custom/provision-10-example.sh b/scripts/custom/provision-10-example.sh index 1cd12d7d3..d9d0b1075 100755 --- a/scripts/custom/provision-10-example.sh +++ b/scripts/custom/provision-10-example.sh @@ -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 "$@"; } @@ -36,26 +38,31 @@ 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', 'YOURSITE')->save();" + pass "Set site name." #;< MODULES 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." #;> MODULES #;< SERVICE_REDIS task "Installing Redis module." drush pm:install redis || true + pass "Installed Redis module." #;> SERVICE_REDIS #;< SERVICE_CLAMAV task "Installing and configuring ClamAV." drush pm:install clamav drush config-set clamav.settings mode_daemon_tcpip.hostname clamav + pass "Installed and configured ClamAV." #;> SERVICE_CLAMAV #;< SERVICE_SOLR task "Installing Solr search modules." drush pm:install search_api search_api_solr + pass "Installed Solr search modules." #;> SERVICE_SOLR # Enable custom site module and run its deployment hooks. @@ -74,9 +81,11 @@ if echo "${environment}" | grep -q -e dev -e stage -e ci -e local; then #;< CUSTOM_MODULE_DEMO drush pm:install ys_demo #;> CUSTOM_MODULE_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 diff --git a/scripts/custom/provision-20-migration.sh b/scripts/custom/provision-20-migration.sh index fa75d7649..46ab2921c 100755 --- a/scripts/custom/provision-20-migration.sh +++ b/scripts/custom/provision-20-migration.sh @@ -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 "$@"; } @@ -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 @@ -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 diff --git a/scripts/vortex/deploy-artifact.sh b/scripts/vortex/deploy-artifact.sh index 6a61d4ea1..61d86db59 100755 --- a/scripts/vortex/deploy-artifact.sh +++ b/scripts/vortex/deploy-artifact.sh @@ -60,10 +60,10 @@ VORTEX_DEPLOY_ARTIFACT_GIT_ARTIFACT_SHA256="${VORTEX_DEPLOY_ARTIFACT_GIT_ARTIFAC # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/deploy-container-registry.sh b/scripts/vortex/deploy-container-registry.sh index 4eb5dbae8..7542fd4dd 100755 --- a/scripts/vortex/deploy-container-registry.sh +++ b/scripts/vortex/deploy-container-registry.sh @@ -35,10 +35,10 @@ VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS="${VORTEX_DEPLOY_CONTAINER_REGISTRY_PASS:- # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/deploy-lagoon.sh b/scripts/vortex/deploy-lagoon.sh index 5dd883a09..f85ca14a1 100755 --- a/scripts/vortex/deploy-lagoon.sh +++ b/scripts/vortex/deploy-lagoon.sh @@ -81,10 +81,10 @@ VORTEX_DEPLOY_LAGOON_FAIL_ENV_LIMIT_EXCEEDED="${VORTEX_DEPLOY_LAGOON_FAIL_ENV_LI # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } # Check if error output contains Lagoon environment limit exceeded message. diff --git a/scripts/vortex/deploy-webhook.sh b/scripts/vortex/deploy-webhook.sh index 75360d45f..66f7a9631 100755 --- a/scripts/vortex/deploy-webhook.sh +++ b/scripts/vortex/deploy-webhook.sh @@ -23,10 +23,10 @@ VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS="${VORTEX_DEPLOY_WEBHOOK_RESPONSE_STATUS:- # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/deploy.sh b/scripts/vortex/deploy.sh index 1427a7d44..e571c14d7 100755 --- a/scripts/vortex/deploy.sh +++ b/scripts/vortex/deploy.sh @@ -52,10 +52,10 @@ VORTEX_DEPLOY_ALLOW_SKIP="${VORTEX_DEPLOY_ALLOW_SKIP:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/doctor.sh b/scripts/vortex/doctor.sh index 7934d57ba..d015afebf 100755 --- a/scripts/vortex/doctor.sh +++ b/scripts/vortex/doctor.sh @@ -65,10 +65,10 @@ VORTEX_SSH_FILE="${VORTEX_SSH_FILE:-${HOME}/.ssh/id_rsa}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } fail() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[31m[FAIL] %s\033[0m\n" "${1}" || printf "[FAIL] %s\n" "${1}"; } warn() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[33m[WARN] %s\033[0m\n" "${1}" || printf "[WARN] %s\n" "${1}"; } # @formatter:on diff --git a/scripts/vortex/download-db-acquia.sh b/scripts/vortex/download-db-acquia.sh index 5a65c3b67..a79ca9520 100755 --- a/scripts/vortex/download-db-acquia.sh +++ b/scripts/vortex/download-db-acquia.sh @@ -76,10 +76,10 @@ VORTEX_DOWNLOAD_DB_ACQUIA_BACKUP_MAX_WAIT="${!_v:-600}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db-container-registry.sh b/scripts/vortex/download-db-container-registry.sh index 963337c84..34574ffe5 100755 --- a/scripts/vortex/download-db-container-registry.sh +++ b/scripts/vortex/download-db-container-registry.sh @@ -48,10 +48,10 @@ VORTEX_DOWNLOAD_DB_CONTAINER_REGISTRY_IMAGE_BASE="${!_v:-${!_vs:-}}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db-ftp.sh b/scripts/vortex/download-db-ftp.sh index f4a69278d..ef661a328 100755 --- a/scripts/vortex/download-db-ftp.sh +++ b/scripts/vortex/download-db-ftp.sh @@ -50,10 +50,10 @@ VORTEX_DOWNLOAD_DB_FTP_DB_FILE="${!_v:-${!_vs:-${!_vss:-db.sql}}}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db-lagoon.sh b/scripts/vortex/download-db-lagoon.sh index 30f40d5b3..80bf45ca6 100755 --- a/scripts/vortex/download-db-lagoon.sh +++ b/scripts/vortex/download-db-lagoon.sh @@ -90,10 +90,10 @@ WEBROOT="${WEBROOT:-web}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db-s3.sh b/scripts/vortex/download-db-s3.sh index 79f69716a..d1d29897b 100755 --- a/scripts/vortex/download-db-s3.sh +++ b/scripts/vortex/download-db-s3.sh @@ -52,10 +52,10 @@ VORTEX_DOWNLOAD_DB_S3_DB_FILE="${!_v:-${!_vs:-${!_vss:-db.sql}}}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db-url.sh b/scripts/vortex/download-db-url.sh index 8f49cfd43..051c3b8ff 100755 --- a/scripts/vortex/download-db-url.sh +++ b/scripts/vortex/download-db-url.sh @@ -39,10 +39,10 @@ VORTEX_DOWNLOAD_DB_UNZIP_PASSWORD="${!_v:-}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/download-db.sh b/scripts/vortex/download-db.sh index e402bdf4e..9682200ed 100755 --- a/scripts/vortex/download-db.sh +++ b/scripts/vortex/download-db.sh @@ -45,10 +45,10 @@ VORTEX_DOWNLOAD_DB_DIR="${!_v:-${!_vs:-./.data}}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/export-db-file.sh b/scripts/vortex/export-db-file.sh index c00bd59f2..19f62059f 100755 --- a/scripts/vortex/export-db-file.sh +++ b/scripts/vortex/export-db-file.sh @@ -15,10 +15,10 @@ VORTEX_EXPORT_DB_FILE_DIR="${VORTEX_EXPORT_DB_FILE_DIR:-${VORTEX_DB_DIR:-./.data # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/export-db-image.sh b/scripts/vortex/export-db-image.sh index 727b029f9..174be4c78 100755 --- a/scripts/vortex/export-db-image.sh +++ b/scripts/vortex/export-db-image.sh @@ -29,10 +29,10 @@ VORTEX_EXPORT_DB_IMAGE_DIR="${VORTEX_EXPORT_DB_IMAGE_DIR:-${VORTEX_DB_DIR}}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/export-db.sh b/scripts/vortex/export-db.sh index d5b467270..79aab82e2 100755 --- a/scripts/vortex/export-db.sh +++ b/scripts/vortex/export-db.sh @@ -21,10 +21,10 @@ VORTEX_EXPORT_DB_IMAGE="${VORTEX_EXPORT_DB_IMAGE:-${VORTEX_DB_IMAGE:-}}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/info.sh b/scripts/vortex/info.sh index 8b1e9a6f0..75fc5dc2a 100755 --- a/scripts/vortex/info.sh +++ b/scripts/vortex/info.sh @@ -18,10 +18,10 @@ VORTEX_SHOW_LOGIN="${VORTEX_SHOW_LOGIN:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/login-container-registry.sh b/scripts/vortex/login-container-registry.sh index f320c066b..7340cb8aa 100755 --- a/scripts/vortex/login-container-registry.sh +++ b/scripts/vortex/login-container-registry.sh @@ -37,10 +37,10 @@ VORTEX_LOGIN_CONTAINER_REGISTRY_DOCKER_CONFIG="${VORTEX_LOGIN_CONTAINER_REGISTRY # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/login.sh b/scripts/vortex/login.sh index 4332d605a..a447b1d15 100755 --- a/scripts/vortex/login.sh +++ b/scripts/vortex/login.sh @@ -15,10 +15,10 @@ VORTEX_LOGIN_UNBLOCK_ADMIN="${VORTEX_LOGIN_UNBLOCK_ADMIN:-${VORTEX_UNBLOCK_ADMIN # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/logout.sh b/scripts/vortex/logout.sh index fb7eb6ec3..02e00ecde 100755 --- a/scripts/vortex/logout.sh +++ b/scripts/vortex/logout.sh @@ -15,10 +15,10 @@ VORTEX_LOGOUT_BLOCK_ADMIN="${VORTEX_LOGOUT_BLOCK_ADMIN:-${VORTEX_UNBLOCK_ADMIN:- # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-email.sh b/scripts/vortex/notify-email.sh index 7abe90fd5..f3655d150 100755 --- a/scripts/vortex/notify-email.sh +++ b/scripts/vortex/notify-email.sh @@ -58,10 +58,10 @@ VORTEX_NOTIFY_EMAIL_BRANCHES="${VORTEX_NOTIFY_EMAIL_BRANCHES:-}" #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-github.sh b/scripts/vortex/notify-github.sh index 9d39c9e9e..73e5e60fd 100755 --- a/scripts/vortex/notify-github.sh +++ b/scripts/vortex/notify-github.sh @@ -49,10 +49,10 @@ VORTEX_NOTIFY_GITHUB_BRANCHES="${VORTEX_NOTIFY_GITHUB_BRANCHES:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-jira.sh b/scripts/vortex/notify-jira.sh index 0a513c79e..fad5911d0 100755 --- a/scripts/vortex/notify-jira.sh +++ b/scripts/vortex/notify-jira.sh @@ -69,10 +69,10 @@ VORTEX_NOTIFY_JIRA_BRANCHES="${VORTEX_NOTIFY_JIRA_BRANCHES:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-newrelic.sh b/scripts/vortex/notify-newrelic.sh index 8499b06e7..23c57a4d6 100755 --- a/scripts/vortex/notify-newrelic.sh +++ b/scripts/vortex/notify-newrelic.sh @@ -80,10 +80,10 @@ VORTEX_NOTIFY_NEWRELIC_BRANCHES="${VORTEX_NOTIFY_NEWRELIC_BRANCHES:-main,master, # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-slack.sh b/scripts/vortex/notify-slack.sh index 197e8a890..4df55ca46 100755 --- a/scripts/vortex/notify-slack.sh +++ b/scripts/vortex/notify-slack.sh @@ -55,10 +55,10 @@ VORTEX_NOTIFY_SLACK_BRANCHES="${VORTEX_NOTIFY_SLACK_BRANCHES:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify-webhook.sh b/scripts/vortex/notify-webhook.sh index 192b3eb5c..83dd2633d 100755 --- a/scripts/vortex/notify-webhook.sh +++ b/scripts/vortex/notify-webhook.sh @@ -52,10 +52,10 @@ VORTEX_NOTIFY_WEBHOOK_BRANCHES="${VORTEX_NOTIFY_WEBHOOK_BRANCHES:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/notify.sh b/scripts/vortex/notify.sh index cce0ceefa..3ef7da893 100755 --- a/scripts/vortex/notify.sh +++ b/scripts/vortex/notify.sh @@ -48,10 +48,10 @@ VORTEX_NOTIFY_LOGIN_URL="${VORTEX_NOTIFY_LOGIN_URL:-}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/provision-sanitize-db.sh b/scripts/vortex/provision-sanitize-db.sh index b352e71fd..86895cd67 100755 --- a/scripts/vortex/provision-sanitize-db.sh +++ b/scripts/vortex/provision-sanitize-db.sh @@ -27,10 +27,10 @@ VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE="${VORTEX_PROVISION_SANITIZE_DB_ADD # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/provision.sh b/scripts/vortex/provision.sh index 48ba61098..6b8ba745b 100755 --- a/scripts/vortex/provision.sh +++ b/scripts/vortex/provision.sh @@ -84,10 +84,10 @@ VORTEX_PROVISION_DB_IMAGE="${VORTEX_PROVISION_DB_IMAGE:-${VORTEX_DB_IMAGE:-}}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/reset.sh b/scripts/vortex/reset.sh index 6679b1574..ef69e7c59 100755 --- a/scripts/vortex/reset.sh +++ b/scripts/vortex/reset.sh @@ -12,10 +12,10 @@ set -eu # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/setup-ssh.sh b/scripts/vortex/setup-ssh.sh index 3b1fc6b29..950f96004 100755 --- a/scripts/vortex/setup-ssh.sh +++ b/scripts/vortex/setup-ssh.sh @@ -34,10 +34,10 @@ VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING="${VORTEX_SSH_DISABLE_STRICT_HOST_KE # @formatter:off debg() { if [ "${VORTEX_DEBUG-}" = "1" ]; then printf "[DEBG] %s\n" "$1"; fi; } -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/task-copy-db-acquia.sh b/scripts/vortex/task-copy-db-acquia.sh index c5f4add75..1c10d8475 100755 --- a/scripts/vortex/task-copy-db-acquia.sh +++ b/scripts/vortex/task-copy-db-acquia.sh @@ -46,10 +46,10 @@ VORTEX_TASK_COPY_DB_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_COPY_DB_ACQUIA_STATUS_ #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/task-copy-files-acquia.sh b/scripts/vortex/task-copy-files-acquia.sh index 6b6306ba3..5a1bf6ec6 100755 --- a/scripts/vortex/task-copy-files-acquia.sh +++ b/scripts/vortex/task-copy-files-acquia.sh @@ -43,10 +43,10 @@ VORTEX_TASK_COPY_FILES_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_COPY_FILES_ACQUIA_S #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/task-custom-lagoon.sh b/scripts/vortex/task-custom-lagoon.sh index 562a9c404..93d4120b7 100755 --- a/scripts/vortex/task-custom-lagoon.sh +++ b/scripts/vortex/task-custom-lagoon.sh @@ -53,10 +53,10 @@ VORTEX_TASK_CUSTOM_LAGOON_CLI_VERSION="${VORTEX_TASK_CUSTOM_LAGOON_CLI_VERSION:- # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/task-purge-cache-acquia.sh b/scripts/vortex/task-purge-cache-acquia.sh index ccf38752c..9761862ef 100755 --- a/scripts/vortex/task-purge-cache-acquia.sh +++ b/scripts/vortex/task-purge-cache-acquia.sh @@ -43,10 +43,10 @@ VORTEX_TASK_PURGE_CACHE_ACQUIA_STATUS_INTERVAL="${VORTEX_TASK_PURGE_CACHE_ACQUIA #------------------------------------------------------------------------------- # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/update-vortex.sh b/scripts/vortex/update-vortex.sh index 4555de220..d4cdc0f4d 100755 --- a/scripts/vortex/update-vortex.sh +++ b/scripts/vortex/update-vortex.sh @@ -44,10 +44,10 @@ VORTEX_INSTALLER_INTERACTIVE="${VORTEX_INSTALLER_INTERACTIVE:-0}" # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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 diff --git a/scripts/vortex/upload-db-s3.sh b/scripts/vortex/upload-db-s3.sh index cf7b3f4c0..f7c8a609d 100755 --- a/scripts/vortex/upload-db-s3.sh +++ b/scripts/vortex/upload-db-s3.sh @@ -43,10 +43,10 @@ VORTEX_UPLOAD_DB_S3_STORAGE_CLASS="${VORTEX_UPLOAD_DB_S3_STORAGE_CLASS:-STANDARD # ------------------------------------------------------------------------------ # @formatter:off -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}"; } +note() { printf " %s\n" "${1}"; } +task() { _TASK_START=$(date +%s); [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[34m[TASK] %s\033[0m\n" "${1}" || printf "[TASK] %s\n" "${1}"; } +pass() { _d=""; [ -n "${_TASK_START:-}" ] && _d=" ($(($(date +%s) - _TASK_START))s)" && unset _TASK_START; [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[32m[ OK ] %s%s\033[0m\n" "${1}" "${_d}" || printf "[ OK ] %s%s\n" "${1}" "${_d}"; } 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