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

Commit 5e4dee8

Browse files
authored
Merge pull request #997 from oxyc/env-config-docs
Issue #455: Add docs on environment specific configs
2 parents 0c0a2b8 + 0200d42 commit 5e4dee8

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

docs/other/production.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Drupal VM has _experimental_ support for deploying Drupal VM to a production environment. The security of your servers is _your_ responsibility.
2+
3+
For a configuration example and instructions on how to build a Drupal environment with Drupal VM on DigitalOcean see the [`examples/prod` directory and README](https://github.com/geerlingguy/drupal-vm/tree/master/examples/prod).
4+
5+
## Production specific overrides.
6+
7+
Drupal VM supports loading configuration files depending on the environment variable `DRUPALVM_ENV` and using this feature you can have different configurations between development and production environments.
8+
9+
```sh
10+
# Loads vagrant.config.yml if available (default).
11+
vagrant provision
12+
13+
# Loads prod.config.yml if available.
14+
DRUPALVM_ENV=prod vagrant provision --provisioner=aws
15+
```
16+
17+
If you're issuing a provision directly through `ansible-playbook` as you would do for most production environments you can either set the `DRUPALVM_ENV` variable on your host, or on the remote production machine.
18+
19+
```sh
20+
# By default it doesn't try to load any other config file.
21+
ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass
22+
23+
# Loads prod.config.yml if available.
24+
DRUPALVM_ENV=prod ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass
25+
```
26+
27+
If you add `DRUPALVM_ENV=prod` to the `/etc/environment` file on your production environment:
28+
29+
```sh
30+
# Loads prod.config.yml if available.
31+
ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass
32+
```
33+
34+
_Note: Having the variable set locally takes precedence over having it on the remote machine._

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pages:
4343
- 'PHP 5.6 on Drupal VM': 'other/php-56.md'
4444
- 'BigPipe with Drupal VM': 'other/bigpipe.md'
4545
- 'Drupal VM Management Tools': 'other/management-tools.md'
46+
- 'Deploying Drupal VM to a production environment': 'other/production.md'
4647
- 'Networking Notes': 'other/networking.md'
4748
- 'Drupal 6 Notes': 'other/drupal-6.md'
4849
- 'Linux Notes': 'other/linux.md'

0 commit comments

Comments
 (0)