-
Notifications
You must be signed in to change notification settings - Fork 13
/
platform.yaml
executable file
·63 lines (53 loc) · 3.28 KB
/
platform.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ddev-generated
# Example Platform.sh provider configuration.
# To use this configuration,
# 1. Check out the site from platform.sh 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 Platform.sh Dashboard and go to Account->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:
# - PLATFORMSH_CLI_TOKEN=abcdeyourtoken
# ```
# 3. `ddev restart`
# 4. Obtain your project id with `ddev exec platform`. The platform tool should show you all the information about your account and project.
# 5. In your project's .ddev/providers directory, copy platform.yaml.example to platform.yaml and edit the `project_id` and `environment_name`.
# 6. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded.
# 7. Optionally use `ddev push platform` to push local files and database to platform.sh. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended.
# Debugging: Use `ddev exec platform` to see what platform.sh knows about
# your configuration and whether it's working correctly.
environment_variables:
project_id: yourproject
environment: main
application: drupal
auth_command:
command: |
set -eu -o pipefail
if [ -z "${PLATFORMSH_CLI_TOKEN:-}" ]; then echo "Please make sure you have set PLATFORMSH_CLI_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi
db_pull_command:
command: |
set -x # You can enable bash debugging output by uncommenting
set -eu -o pipefail
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
platform db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${project_id}" --environment="${environment}" --app="${application}"
files_pull_command:
command: |
set -x # You can enable bash debugging output by uncommenting
set -eu -o pipefail
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
platform mount:download --yes --quiet --project="${project_id}" --environment="${environment}" --app="${application}" --mount=web/sites/default/files --target=/var/www/html/.ddev/.downloads/files
# 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
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 | platform db:sql --project="${project_id}" --environment="${environment}"
# 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
ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible
platform mount:upload --yes --quiet --project="${project_id}" --environment="${environment}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files