Ask Your Question
0

post-receive hook not invoked when pushing changes to remote git repository

asked 2018-10-18 01:22:59 -0600

sanketshirude07 gravatar image

updated 2018-10-18 01:24:36 -0600

I am trying to automate the r10k deployment using git hooks. I am making changes on local system and pushing to remote git repository. I want that r10k should auto deploy once the changes are pushed . So i wrote the post-receive hook on puppet master which has following script

#!/bin/sh
echo "Deploying r10k new changes received"
/usr/local/rvm/gems/ruby-2.4.4/bin/r10k depoly environment -pv debug

I made that hook executable but still its not getting invoked when i push from my local machine.

edit retag flag offensive close merge delete

Comments

Do you intend for your local system deploy the puppet changes (is this on your master?) a post-recieve hook is only a 'server side' hook, and only triggers if you are pushing code into that repository - https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks. Also, is your file marked executable?

DarylW gravatar imageDarylW ( 2018-10-18 07:28:59 -0600 )edit

i write a code on my local machine and use it to push to git. I have my puppet master which clones the same repository using r10k. So the hook is written on puppet master and it is executable but i'm not able to figure out why it not getting invoked when i push from local machine to git repo??

sanketshirude07 gravatar imagesanketshirude07 ( 2018-10-18 10:00:40 -0600 )edit

do the hooks only work with private repos??

sanketshirude07 gravatar imagesanketshirude07 ( 2018-10-19 04:47:03 -0600 )edit

what are the other options available for continuous integration??

sanketshirude07 gravatar imagesanketshirude07 ( 2018-10-19 05:10:50 -0600 )edit

Sorry to ask what is git server ?? i m pushing code from local machine to repo on github.com and using same repo to clone the code on puppet master

sanketshirude07 gravatar imagesanketshirude07 ( 2018-10-19 07:15:19 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-21 03:52:23 -0600

sanketshirude07 gravatar image

Got it how the hook works!!!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-10-18 01:22:59 -0600

Seen: 193 times

Last updated: Oct 21