Message getting pull hook on gitblit server

I need to set up a post-receive hook script on a Gitblit server that will pull the changes to a website on the same server. In a bash script, the command will look something like this:

sudo git --work-tree=/var/www/html/mysite --git-dir=/var/www/html/mysite/.git pull 

But, as I understand it, Gitblit uses groovy hooks scripts, and I'm completely new to this. Can someone please help me create a groovy script for this, or at least direct me to some good examples or tutorial for Groovy.

thanks

+5
source share
1 answer

If anyone needs help with groovy, here is my groovy script:

 import org.slf4j.Logger def res = ["git", "--work-tree=/var/www/html/mysite", "--git-dir=/var/www/html/mysite/.git", "pull"].execute() println res.err.text println res.text 
+4
source

Source: https://habr.com/ru/post/1206396/


All Articles