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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vortex/docs/.utils/variables/extra/acquia.variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ VORTEX_PURGE_CACHE_ACQUIA_SKIP=
# Skip Drupal site provisioning in Acquia environment.
VORTEX_PROVISION_ACQUIA_SKIP=

# Skip sending of deployment notifications in Acquia environment.
VORTEX_NOTIFY_ACQUIA_SKIP=

# NewRelic API key, usually of type 'USER'.
#
# @see https://www.vortextemplate.com/docs/deployment/notifications/newrelic
Expand Down
1 change: 1 addition & 0 deletions .vortex/docs/content/development/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale
| <a id="vortex_login_container_registry_user"></a>`VORTEX_LOGIN_CONTAINER_REGISTRY_USER` | The username to login into the container registry.<br/><br/>If not provided, the script will skip the login step. | `${VORTEX_CONTAINER_REGISTRY_USER}` | `.vortex/tooling/src/vortex-login-container-registry` |
| <a id="vortex_login_unblock_admin"></a>`VORTEX_LOGIN_UNBLOCK_ADMIN` | Flag to unblock admin. | `1` | `.vortex/tooling/src/vortex-login` |
| <a id="vortex_logout_block_admin"></a>`VORTEX_LOGOUT_BLOCK_ADMIN` | Flag to block or unblock admin. | `1` | `.vortex/tooling/src/vortex-logout` |
| <a id="vortex_notify_acquia_skip"></a>`VORTEX_NOTIFY_ACQUIA_SKIP` | Skip sending of deployment notifications in Acquia environment. | `UNDEFINED` | `ACQUIA ENVIRONMENT` |
| <a id="vortex_notify_branch"></a>`VORTEX_NOTIFY_BRANCH` | Notification git branch name. | `UNDEFINED` | `.vortex/tooling/src/vortex-notify` |
| <a id="vortex_notify_channels"></a>`VORTEX_NOTIFY_CHANNELS` | The channels of the notifications.<br/><br/>A combination of comma-separated values: email,slack,newrelic,github,jira,webhook,diffy | `email` | `.env`, `.vortex/tooling/src/vortex-notify` |
| <a id="vortex_notify_diffy_branch"></a>`VORTEX_NOTIFY_DIFFY_BRANCH` | Diffy notification git branch name. | `${VORTEX_NOTIFY_BRANCH}` | `.vortex/tooling/src/vortex-notify-diffy` |
Expand Down
14 changes: 14 additions & 0 deletions .vortex/docs/content/hosting/acquia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ pre-configured scripts in the [`hooks/`](https://github.com/drevops/vortex/tree/
directory that trigger on code deployments, code updates, and database copy
operations.

Each hook is turned off by setting its skip variable to `1` in the Acquia UI:

| Hook | Variable |
|------------------------|--------------------------------------|
| `provision.sh` | `VORTEX_PROVISION_ACQUIA_SKIP` |
| `purge-cache.sh` | `VORTEX_PURGE_CACHE_ACQUIA_SKIP` |
| `notify-deployment.sh` | `VORTEX_NOTIFY_ACQUIA_SKIP` |
| `copy-db.sh` | `VORTEX_TASK_COPY_DB_ACQUIA_SKIP` |
| `copy-files.sh` | `VORTEX_TASK_COPY_FILES_ACQUIA_SKIP` |

A hook stops with an error when a value it requires is unset or empty, so a
blank field in the Acquia UI aborts the hook rather than running it with a
missing value.

### Environment detection

**Vortex** automatically detects when running on Acquia and loads appropriate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
#
# Environment variables must be set in Acquia UI globally or for each environment.

set -e
set -eu
[ "${VORTEX_DEBUG-}" = "1" ] && set -x

site="${1}"
target_env="${2}"
site="${1:?Missing required site name.}"
target_env="${2:?Missing required target environment name.}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

[ "${VORTEX_TASK_COPY_DB_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of database between Acquia environments." && exit 0
[ "${VORTEX_TASK_COPY_DB_ACQUIA_SKIP:-}" = "1" ] && echo "Skipping copying of database between Acquia environments." && exit 0

export VORTEX_PLATFORM=acquia
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}"
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:?Missing required value.}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:?Missing required value.}"
export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}"
export VORTEX_TASK_COPY_DB_ACQUIA_SRC="${VORTEX_TASK_COPY_DB_ACQUIA_SRC:-prod}"
export VORTEX_TASK_COPY_DB_ACQUIA_DST="${VORTEX_TASK_COPY_DB_ACQUIA_DST:-${target_env}}"
export VORTEX_TASK_COPY_DB_ACQUIA_NAME="${VORTEX_TASK_COPY_DB_ACQUIA_NAME?not set}"
export VORTEX_TASK_COPY_DB_ACQUIA_NAME="${VORTEX_TASK_COPY_DB_ACQUIA_NAME:?Missing required value.}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

./vendor/bin/vortex-task copy-db

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
#
# Environment variables must be set in Acquia UI globally or for each environment.

set -e
set -eu
[ "${VORTEX_DEBUG-}" = "1" ] && set -x

site="${1}"
target_env="${2}"
site="${1:?Missing required site name.}"
target_env="${2:?Missing required target environment name.}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

[ "${VORTEX_TASK_COPY_FILES_ACQUIA_SKIP}" = "1" ] && echo "Skipping copying of files between Acquia environments." && exit 0
[ "${VORTEX_TASK_COPY_FILES_ACQUIA_SKIP:-}" = "1" ] && echo "Skipping copying of files between Acquia environments." && exit 0

export VORTEX_PLATFORM=acquia
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}"
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:?Missing required value.}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:?Missing required value.}"
export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}"
export VORTEX_TASK_COPY_FILES_ACQUIA_SRC="${VORTEX_TASK_COPY_FILES_ACQUIA_SRC:-prod}"
export VORTEX_TASK_COPY_FILES_ACQUIA_DST="${VORTEX_TASK_COPY_FILES_ACQUIA_DST:-${target_env}}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

./vendor/bin/vortex-task copy-files

popd >/dev/null || exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
# Acquia Cloud hook: Send deployment notifications.
#

set -e
set -eu
[ "${VORTEX_DEBUG-}" = "1" ] && set -x

site="${1}"
target_env="${2}"
branch="${3}"
ref="${4}"
site="${1:?Missing required site name.}"
target_env="${2:?Missing required target environment name.}"
branch="${3:?Missing required branch name.}"
ref="${4:?Missing required commit reference.}"

[ "${VORTEX_NOTIFY_ACQUIA_SKIP:-}" = "1" ] && echo "Skipping sending of deployment notifications in Acquia environment." && exit 0

# Custom domain name for the environment, including subdomain.
# Examples: "dev.example.com", "test.example.com", "www.example.com"
VORTEX_NOTIFY_ENVIRONMENT_DOMAIN="${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN:-}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

url="https://${AH_SITE_NAME}.${AH_REALM:-prod}.acquia-sites.com"

if [ -n "${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN}" ]; then
url="https://${VORTEX_NOTIFY_ENVIRONMENT_DOMAIN}"
else
url="https://${AH_SITE_NAME:?Missing required value.}.${AH_REALM:-prod}.acquia-sites.com"
fi

export VORTEX_NOTIFY_PROJECT="${site}"
Expand All @@ -30,6 +30,8 @@ export VORTEX_NOTIFY_PR_NUMBER=""
export VORTEX_NOTIFY_LABEL="${branch}"
export VORTEX_NOTIFY_ENVIRONMENT_URL="${url}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

./vendor/bin/vortex-notify

popd >/dev/null || exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Acquia Cloud hook: Provision site.
#

set -e
set -eu
[ "${VORTEX_DEBUG-}" = "1" ] && set -x

site="${1}"
target_env="${2}"
site="${1:?Missing required site name.}"
target_env="${2:?Missing required target environment name.}"

[ "${VORTEX_PROVISION_ACQUIA_SKIP:-}" = "1" ] && echo "Skipping provisioning of the site in Acquia environment." && exit 0

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
#
# Environment variables must be set in Acquia UI globally or for each environment.

set -e
set -eu
[ "${VORTEX_DEBUG-}" = "1" ] && set -x

site="${1}"
target_env="${2}"
site="${1:?Missing required site name.}"
target_env="${2:?Missing required target environment name.}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

[ "${VORTEX_PURGE_CACHE_ACQUIA_SKIP}" = "1" ] && echo "Skipping purging of cache in Acquia environment." && exit 0
[ "${VORTEX_PURGE_CACHE_ACQUIA_SKIP:-}" = "1" ] && echo "Skipping purging of cache in Acquia environment." && exit 0

export VORTEX_PLATFORM=acquia
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY?not set}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET?not set}"
export VORTEX_ACQUIA_KEY="${VORTEX_ACQUIA_KEY:?Missing required value.}"
export VORTEX_ACQUIA_SECRET="${VORTEX_ACQUIA_SECRET:?Missing required value.}"
export VORTEX_ACQUIA_APP_NAME="${VORTEX_ACQUIA_APP_NAME:-${site}}"
export VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV="${VORTEX_TASK_PURGE_CACHE_ACQUIA_ENV:-${target_env}}"
export VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE="${VORTEX_TASK_PURGE_CACHE_ACQUIA_DOMAINS_FILE:-"/var/www/html/${site}.${target_env}/hooks/library/domains.txt"}"

pushd "/var/www/html/${site}.${target_env}" >/dev/null || exit 1

./vendor/bin/vortex-task purge-cache

popd >/dev/null || exit 1
Loading