开发者

Writing git hooks to perform pull from bare repo to working repo

开发者 https://www.devze.com 2023-03-21 20:05 出处:网络
could anyone help me with this problem. What I have done is I wrote a post-receive hook in a bare-repository to run hudson in my working cop开发者_Go百科y

could anyone help me with this problem. What I have done is I wrote a post-receive hook in a bare-repository to run hudson in my working cop开发者_Go百科y

URL='http://192.168.1.1:8082/job/Jobforone/build'
echo "Run Hudson build at $URL"
wget $URL > /dev/null 2>&1

When I push from other remote computers to the bare repository in the 192.168.1.1(local server) hook is executed and hudson build is run in the working copy of the 192.168.1.1(local server) but the problem is working copy of 192.168.1.1 has not yet been updated until git pull is executed. So the hudson build runs on the same copy again and again(which makes no sense). So could anyone help me how could I write the hook that would perform pull on the local working copy and then perform the hudson build (above code).


I use Jenkins (very close to Hunson). I set-up post-hook (on a Github), as soon as push happend it triggers my Jenkins. What Jenkins does is run get fetch to update and then builds! It never run on working copy as you described.

Check out your build settings, don't forget to enable Git.

0

精彩评论

暂无评论...
验证码 换一张
取 消