Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit ef5773a

Browse files
committed
Update scripts docs to apply to both methods of integrating Drupal VM [ci skip]
1 parent 2af3f2e commit ef5773a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/extending/scripts.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@ Drupal VM allows you to run extra shell scripts and ansible task files in the be
22

33
## Shell scripts
44

5-
To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`:
5+
To use an extra script, configure the path to the script (relative to provisioning/playbook.yml) in `config.yml`. You can use the `{{ config_dir }}` variable to point to the directory where your `config.yml` is located.
66

77
```yaml
88
pre_provision_scripts:
9-
- "../scripts/pre-provision.sh"
9+
- "{{ config_dir }}/scripts/pre-provision.sh"
1010
post_provision_scripts:
11-
- "../scripts/post-provision.sh"
11+
- "{{ config_dir }}/scripts/post-provision.sh"
1212
```
1313
1414
The above example results in a `pre-provision.sh` script running before the provisioning starts and a `post-provision.sh` script running after the main Drupal VM setup is complete. Pre and post provision scripts run after the first `vagrant up`, and then any time you run Vagrant provisioning (e.g. `vagrant provision` or `vagrant up --provision`).
1515

1616
_Note: The pre provision scripts run before any other packages are installed. If you want to use commands such as `git`, you need to install the packages yourself._
1717

18-
You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`).
18+
You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `- "{{ config_dir }}/scripts/setup-paths.sh --option"`).
1919

2020
Place your pre and post provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without overwriting your scripts.
2121

2222
## Ansible task files
2323

24-
To use an extra ansible task file, configure the path to the file (relative to `provisioning/playbook.yml`) in `config.yml`:
24+
To use an extra ansible task file, configure the path to the file in `config.yml`:
2525

2626
```yaml
27-
pre_provision_tasks_dir: "../scripts/pre/*"
28-
post_provision_tasks_dir: "../scripts/post-provision.yml"
27+
pre_provision_tasks_dir: "{{ config_dir }}/scripts/pre/*"
28+
post_provision_tasks_dir: "{{ config_dir }}/scripts/post-provision.yml"
2929
```
3030

3131
The path will be evaluated as a [glob pattern](https://docs.python.org/2/library/glob.html) so you can point to a single file or a directory matching a set of files.

0 commit comments

Comments
 (0)