Data Across Multiple Environments¶
Lets say you have an app that you wish to deploy in two environments: staging and production, with the dev VM as the default. A good layout for this would be:
deploy.pyinventories/production.py- production inventoryinventories/staging.py- staging inventorygroup_data/all.py- shared datagroup_data/production.py- production datagroup_data/staging.py- staging data
The “all” group data contains any shared info and defaults:
# group_data/all.py
env = 'dev'
git_repo = 'https://github.com/Fizzadar/pyinfra'
And the production/staging data describe the differences:
# group_data/production.py
env = 'production'
git_branch = 'master'
# group_data/staging.py
env = 'staging'
git_branch = 'develop'
pyinfra 2.x