Use Git's post-receive hook to deploy dynamic Puppet environments with r10k.
Copyright © 2014 Todd A. Jacobs
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see Licenses.
Make sure r10k and the correct Ruby version are both in the PATH when running sudo, especially if you're using Puppet Enterprise or a Ruby version manager like RVM, rbenv, or chruby.
Rename this file to .git/hooks/post-receive in an r10k-tracked repository.
Make hook executable: chmod 755 .git/hooks/post-receive
Push as usual.