diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2008-07-09 10:25:27 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2008-07-09 10:36:32 -0400 |
commit | ecd43460738266b95fefdf84a4fb87d3d01eaf40 (patch) | |
tree | c9bc953b3fa58df59f6ffb21149b9476773df88e /genome-sync | |
parent | 0cbd015aec07e51994f6e4e6de0cccde1b5ccb9d (diff) | |
download | tools-ecd43460738266b95fefdf84a4fb87d3d01eaf40.tar.gz tools-ecd43460738266b95fefdf84a4fb87d3d01eaf40.tar.xz tools-ecd43460738266b95fefdf84a4fb87d3d01eaf40.zip |
The genomerepo::appliance puppet class now handles laying down the puppet hooks
Fixes: https://engineering.redhat.com/trac/IT_Architecture/ticket/191
Previously this was done with genome-sync. That was a hack that only worked
for puppet modules that were being sync'd. If someone manually created a
puppet module under /pub/git/puppet/ the hook would not get laid down.
The current limitation of this solution is that it does not allow users to
easily customize their post-receive hooks. They could edit
/etc/genome/post-receive.template but that's would not allow for fine grained
customization. We'll cross that bridge when we get there.
Diffstat (limited to 'genome-sync')
-rw-r--r-- | genome-sync/bin/genome-sync | 34 | ||||
-rw-r--r-- | genome-sync/extra/genome-sync.spec | 2 |
2 files changed, 1 insertions, 35 deletions
diff --git a/genome-sync/bin/genome-sync b/genome-sync/bin/genome-sync index 909c43d..c65ae6e 100644 --- a/genome-sync/bin/genome-sync +++ b/genome-sync/bin/genome-sync @@ -141,14 +141,6 @@ Main { # HACK: I couldn't get the git gem to clone the working dir for the # puppetmaster and the bare repo for gitweb. This is a workaround. FileUtils.mv(File.join(puppetmaster_dir, ".git"), dest) - - # Lay down hook to update the puppetmaster - hook_file = File.join(dest, "hooks/post-receive") - File.open(hook_file, "w") do |f| - verbose("Laying down #{hook_file}") - f.puts(puppet_post_receive_hook) - end - File.chmod(0744, hook_file) else Git.clone(d, bare_repo_name, @@ -344,30 +336,4 @@ Main { yield(git) end end - - # I _really_ don't like putting this in this tool. I couldn't figure out a - # way to lay it down with puppet. - def puppet_post_receive_hook - <<-HOOK -#!/bin/sh - -update_working_dir() { - GIT_DIR=`pwd` - GIT_WORK_TREE="/etc/puppet/modules/main/`/bin/basename $GIT_DIR`" - - pushd $GIT_WORK_TREE - git --git-dir=$GIT_DIR reset --hard $1 - echo "$GIT_WORK_TREE updated." - popd -} - -while read oldrev newrev ref; do - # We only care when master gets updated - if [[ $ref == 'refs/heads/master' ]] - then - update_working_dir $newrev - fi -done - HOOK - end } diff --git a/genome-sync/extra/genome-sync.spec b/genome-sync/extra/genome-sync.spec index 300f030..a3eeb76 100644 --- a/genome-sync/extra/genome-sync.spec +++ b/genome-sync/extra/genome-sync.spec @@ -6,7 +6,7 @@ Summary: A tool for syncronizing Genome Repositories Name: rubygem-%{gemname} Version: 1.0.0 -Release: 5%{?dist} +Release: 6%{?dist} Group: Development/Languages License: GPLv2 URL: https://fedorahosting.org/genome |