-
-
Notifications
You must be signed in to change notification settings - Fork 28
[#2351] Added per-step timing to 'task()' and 'pass()' functions. #2473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
bc9c3b5
bc2786a
8d67173
1c31a33
b1df9fa
c09ba92
95fdb84
7f4bf2d
13ec3db
530f8a1
3f6fa8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,9 +19,13 @@ set -eu | |||||||||||||||
|
|
||||||||||||||||
| # ------------------------------------------------------------------------------ | ||||||||||||||||
|
|
||||||||||||||||
| info() { printf " ==> %s\n" "${1}"; } | ||||||||||||||||
| task() { printf " > %s\n" "${1}"; } | ||||||||||||||||
| # @formatter:off | ||||||||||||||||
| info() { [ "${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\033[36m[INFO] %s\033[0m\n" "${1}" || printf "[INFO] %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 | ||||||||||||||||
|
|
||||||||||||||||
| drush() { ./vendor/bin/drush -y "$@"; } | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -36,26 +40,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." | ||||||||||||||||
|
Comment on lines
51
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not report Redis install as successful when failure is explicitly tolerated. With Suggested fix- drush pm:install redis || true
- pass "Installed Redis module."
+ if drush pm:install redis; then
+ pass "Installed Redis module."
+ else
+ note "Redis module was not installed. Continuing."
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| #;> 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 +83,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 | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.