This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #997 from oxyc/env-config-docs
Issue #455: Add docs on environment specific configs
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Drupal VM has _experimental_ support for deploying Drupal VM to a production environment. The security of your servers is _your_ responsibility. | ||
|
||
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). | ||
|
||
## Production specific overrides. | ||
|
||
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. | ||
|
||
```sh | ||
# Loads vagrant.config.yml if available (default). | ||
vagrant provision | ||
|
||
# Loads prod.config.yml if available. | ||
DRUPALVM_ENV=prod vagrant provision --provisioner=aws | ||
``` | ||
|
||
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. | ||
|
||
```sh | ||
# By default it doesn't try to load any other config file. | ||
ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass | ||
|
||
# Loads prod.config.yml if available. | ||
DRUPALVM_ENV=prod ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass | ||
``` | ||
|
||
If you add `DRUPALVM_ENV=prod` to the `/etc/environment` file on your production environment: | ||
|
||
```sh | ||
# Loads prod.config.yml if available. | ||
ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass | ||
``` | ||
|
||
_Note: Having the variable set locally takes precedence over having it on the remote machine._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters