Using Vagrant to manage development and production environments?

前端 未结 4 1644
北荒
北荒 2021-02-13 10:57

How are people handling simple automation (with puppet) for dev / prod environments with vagrant (ideally from the same vagrantfile)?

Use case I\'m trying to sol

4条回答
  •  一整个雨季
    2021-02-13 11:55

    Not an ideal solution, but what about using git branches? My thinking is that it could be conceptually similar to using heroku, where you might have a master, staging, and production versions (since they're usually different remotes).

    In this case you start off the prod branch with the small edit to the Vagrantfile to name the VM a little differently. Then you should be able to merge all changes from dev with the prod branch as they occur. So your workflow would look like:

    $ git checkout prod
    $ vagrant up
    $ git checkout master
    ...  make changes to puppet ...
    $ git checkout prod
    $ git merge master
    $ vagrant reload
    $ git checkout master
    

    You could script and alias these so you end up with

    $ start_production
    $ reload_production
    

提交回复
热议问题