This commit is contained in:
71
.ddev/providers/acquia.yaml
Executable file
71
.ddev/providers/acquia.yaml
Executable file
@@ -0,0 +1,71 @@
|
||||
#ddev-generated
|
||||
# Acquia provider configuration.
|
||||
|
||||
# To use this configuration,
|
||||
|
||||
# 1. Get your Acquia API token from your Account Settings->API Tokens.
|
||||
# 2. Make sure your ssh key is authorized on your Acquia account at Account Settings->SSH Keys
|
||||
# 3. `ddev auth ssh` (this typically needs only be done once per ddev session, not every pull).
|
||||
# 4. Add / update the web_environment section in ~/.ddev/global_config.yaml
|
||||
# or your project config.yamlwith the API keys:
|
||||
# ```yaml
|
||||
# web_environment:
|
||||
# - ACQUIA_API_KEY=xxxxxxxx
|
||||
# - ACQUIA_API_SECRET=xxxxx
|
||||
# ```
|
||||
# 5. Add the ACQUIA_ENVIRONMENT_ID environment variable to your project config.yaml, for example:
|
||||
# ```yaml
|
||||
# web_environment:
|
||||
# - ACQUIA_ENVIRONMENT_ID=project1.dev
|
||||
# - On the Acquia Cloud Platform you can find this out by navigating to the environments page,
|
||||
# clicking on the header and look for the "SSH URL" line.
|
||||
# Eg. `project1.dev@cool-projects.acquia-sites.com` would have a project ID of `project1.dev`
|
||||
# 6. `ddev restart`
|
||||
# 7. Use `ddev pull acquia` to pull the project database and files.
|
||||
# 8. Optionally use `ddev push acquia` to push local files and database to Acquia. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended.
|
||||
|
||||
# Debugging: Use `ddev exec acli command` and `ddev exec acli auth:login`
|
||||
|
||||
# Instead of setting the environment variables in configuration files, you can use
|
||||
# `ddev pull acquia --environment=ACQUIA_ENVIRONMENT_ID=yourproject.dev` for example
|
||||
|
||||
auth_command:
|
||||
command: |
|
||||
set -eu -o pipefail
|
||||
if [ -z "${ACQUIA_API_KEY:-}" ] || [ -z "${ACQUIA_API_SECRET:-}" ]; then echo "Please make sure you have set ACQUIA_API_KEY and ACQUIA_API_SECRET in ~/.ddev/global_config.yaml" && exit 1; fi
|
||||
if [ -z "${ACQUIA_ENVIRONMENT_ID:-}" ] ; then echo "Please set ACQUIA_ENVIRONMENT_ID via config.yaml or with '--environment=ACQUIA_ENVIRONMENT_ID=xxx'" && exit 1; fi
|
||||
ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 )
|
||||
acli -n auth:login -n --key="${ACQUIA_API_KEY}" --secret="${ACQUIA_API_SECRET}"
|
||||
|
||||
db_pull_command:
|
||||
command: |
|
||||
set -eu -o pipefail
|
||||
# xargs here just trims whitespace
|
||||
# We could use an easier technique when https://github.com/acquia/cli/issues/1629 is resolved
|
||||
# just using `acli pull:db ${ACQUIA_ENVIRONMENT_ID}`
|
||||
echo "Using ACQUIA_ENVIRONMENT_ID=${ACQUIA_ENVIRONMENT_ID}"
|
||||
set -x # You can enable bash debugging output by uncommenting
|
||||
db_dump=$(acli pull:db ${ACQUIA_ENVIRONMENT_ID} --no-interaction --no-import | tail -2l | xargs)
|
||||
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
|
||||
cp ${db_dump} /var/www/html/.ddev/.downloads/db.sql.gz
|
||||
|
||||
files_import_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
acli -n pull:files ${ACQUIA_ENVIRONMENT_ID}
|
||||
|
||||
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
|
||||
db_push_command:
|
||||
command: |
|
||||
set -eu -o pipefail
|
||||
export ACLI_DB_HOST=db ACLI_DB_NAME=db ACLI_DB_USER=db ACLI_DB_PASSWORD=db
|
||||
set -x # You can enable bash debugging output by uncommenting
|
||||
acli push:db ${ACQUIA_ENVIRONMENT_ID} --no-interaction
|
||||
|
||||
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
|
||||
files_push_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
acli push:files ${ACQUIA_ENVIRONMENT_ID} --no-interaction
|
||||
71
.ddev/providers/upsun.yaml
Executable file
71
.ddev/providers/upsun.yaml
Executable file
@@ -0,0 +1,71 @@
|
||||
#ddev-generated
|
||||
# Upsun provider configuration. This works out of the box, but can be edited to add
|
||||
# your own preferences. If you edit it, remove the `ddev-generated` line from the top so
|
||||
# that it won't be overwritten.
|
||||
|
||||
# To use this configuration,
|
||||
|
||||
# 1. Check out the site from Upsun and then configure it with `ddev config`. You'll want to use `ddev start` and make sure the basic functionality is working.
|
||||
# 2. Obtain and configure an API token.
|
||||
# a. Login to the Upsun Dashboard and go to My Profile->API Tokens to create an API token for DDEV to use.
|
||||
# b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml:
|
||||
# ```yaml
|
||||
# web_environment:
|
||||
# - UPSUN_CLI_TOKEN=abcdeyourtoken
|
||||
# ```
|
||||
# 3. Add UPSUN_PROJECT and UPSUN_ENVIRONMENT variables to your project `.ddev/config.yaml` or a `.ddev/config.upsun.yaml`
|
||||
# ```yaml
|
||||
# web_environment:
|
||||
# - UPSUN_PROJECT=nf4amudfn23biyourproject
|
||||
# - UPSUN_ENVIRONMENT=main
|
||||
# 4. `ddev restart`
|
||||
# 5. Run `ddev pull upsun`. After you agree to the prompt, the current upstream database and files will be downloaded.
|
||||
# 6. Optionally use `ddev push upsun` to push local files and database to Upsun. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended.
|
||||
|
||||
# Debugging: Use `ddev exec upsun` to see what Upsun knows about
|
||||
# your configuration and whether it's working correctly.
|
||||
|
||||
auth_command:
|
||||
command: |
|
||||
set -eu -o pipefail
|
||||
if [ -z "${UPSUN_CLI_TOKEN:-}" ]; then echo "Please make sure you have set UPSUN_CLI_TOKEN." && exit 1; fi
|
||||
if [ -z "${UPSUN_PROJECT:-}" ]; then echo "Please make sure you have set UPSUN_PROJECT." && exit 1; fi
|
||||
if [ -z "${UPSUN_ENVIRONMENT:-}" ]; then echo "Please make sure you have set UPSUN_ENVIRONMENT." && exit 1; fi
|
||||
|
||||
db_pull_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
export UPSUN_CLI_NO_INTERACTION=1
|
||||
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
|
||||
upsun db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${UPSUN_PROJECT}" --environment="${UPSUN_ENVIRONMENT}"
|
||||
|
||||
files_import_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
export UPSUN_CLI_NO_INTERACTION=1
|
||||
# Use $UPSUN_MOUNTS if it exists to get list of mounts to download, otherwise just web/sites/default/files (drupal)
|
||||
declare -a mounts=(${UPSUN_MOUNTS:-/web/sites/default/files})
|
||||
upsun mount:download --all --yes --quiet --project="${UPSUN_PROJECT}" --environment="${UPSUN_ENVIRONMENT}" --target=/var/www/html
|
||||
|
||||
|
||||
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
|
||||
db_push_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
export UPSUN_CLI_NO_INTERACTION=1
|
||||
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
|
||||
pushd /var/www/html/.ddev/.downloads >/dev/null
|
||||
gzip -dc db.sql.gz | upsun db:sql --project="${UPSUN_PROJECT}" --environment="${UPSUN_ENVIRONMENT}"
|
||||
|
||||
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
|
||||
# TODO: This is a naive, Drupal-centric push, which needs adjustment for the mount to be pushed.
|
||||
files_push_command:
|
||||
command: |
|
||||
# set -x # You can enable bash debugging output by uncommenting
|
||||
set -eu -o pipefail
|
||||
export UPSUN_CLI_NO_INTERACTION=1
|
||||
ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible
|
||||
upsun mount:upload --yes --quiet --project="${UPSUN_PROJECT}" --environment="${UPSUN_ENVIRONMENT}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files
|
||||
Reference in New Issue
Block a user