git - Integration of Jenkins and GitBlit -


is there way configure jenkins , gitblit builds run automatically whenever new code pushed git?

i've heard using hook , post-jenknkins scripts in gitblit , configuring 'poll scm' in jenkins perhaps there more sophiscated configurations?

thanks lot.

there 2 ways use jenkins , gitblit build code. first have jenkins poll scm (gitblit in case) changes, , second set post-receive hook in gitblit.

polling gitblit changes simplest set comes additional overhead on server jenkins running on. basic premise jenkins clone repo , compare against previous clone changes. if there difference triggers build. many jobs , several repositories tax jenkins server , possibly gitblit server well. set check poll scm box , choose schedule. schedule field uses cron syntax , clicking on ? next field provide example.

setting post-receive hook more complicated provides true build-on-commit semantics. there 2 ways in jenkins, remote trigger or use gitblit's jenkins hook. remote trigger requires create token each job sent job. since token specific job jenkins building you'll have add new job/token pair each job running against each repository. while isn't resource waste jenkins or gitblit, waste time maintaining these pairs.

gitblit's jenkins hook simple , can use either globally or specific repositories. enable this, edit jenkins.groovy found in ${appserver.base}/groovy ${appserver.base} ever set during installation. edit def jenkinsurl = gitblit.getstring('groovy.jenkinsserver', 'http://your/jenkins/url') line url of jenkins server. set groovy.jenkinsserver in gitblit.properties file. force repositories use hook script add groovy.postreceivescripts line in gitblit.properties file. otherwise edit repository in gitblit web app , add jenkins post-receive hook list.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -