You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/extending/scripts.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,30 @@ Drupal VM allows you to run extra shell scripts and ansible task files in the be
2
2
3
3
## Shell scripts
4
4
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.
6
6
7
7
```yaml
8
8
pre_provision_scripts:
9
-
- "../scripts/pre-provision.sh"
9
+
- "{{ config_dir }}/scripts/pre-provision.sh"
10
10
post_provision_scripts:
11
-
- "../scripts/post-provision.sh"
11
+
- "{{ config_dir }}/scripts/post-provision.sh"
12
12
```
13
13
14
14
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`).
15
15
16
16
_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._
17
17
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"`).
19
19
20
20
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.
21
21
22
22
## Ansible task files
23
23
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`:
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