Help talk:Self-hosted puppetmaster

From Wikitech
Jump to navigation Jump to search

precise up to date

The manual says that a precise instance should be used. Is that still up to date for new developments?

good point, for new developments trusty is preferred and is what we are migrating to, I've fixed the page, thanks! --Filippo Giunchedi (talk) 08:42, 28 July 2014 (UTC)

setting up /var/lib/git/operations/puppet as pushable

under "how do I submit my changes to gerrit?" it is suggested to push straight to the repo, git will by default refuse to push on the same branch on a non-bare repo because it confuses the index and the working tree. A compromise I found is to push to a bare repo (perhaps in one's home directory) and have that repo's post-receive hook in turn update the main repo as such:

$ cat puppet.git/hooks/post-receive 
set -e
set -u

[ "$(git config core.bare)" = 'false' ] && repo_dir=$PWD/..

cd /var/lib/git/operations/puppet
sudo git fetch "$repo_dir"
sudo git reset --hard FETCH_HEAD

--Filippo Giunchedi (talk) 10:06, 1 August 2014 (UTC)

Nice! I typically have a "dummy", not-checked-out branch that I overwrite (git push -f $REMOTEREPO HEAD:test-commit) and then reset to that. --Tim Landscheidt (talk) 02:00, 4 August 2014 (UTC)