An alternative way of invoking jenkins after svn commit
Tech-Today

An alternative way of invoking jenkins after svn commit


This page assumes that you have already setup the following in your Ubuntu 12.04 system:
1.) Jenkins
2.) Artifactory
3.) SVN

Normally we use this plugin: https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin, where we edit the svn's post-commit hook and write the following code, but it doesn't work for me :-) (we assume that you have your repositories in /var/subversion):

#!/bin/sh

REPOS="$1"
REV="$2"
UUID=`svnlook uuid $REPOS`

/usr/bin/wget \
--header "Content-Type:text/plain;charset=UTF-8" \
--post-data "'svnlook changed --revision $REV $REPOS'" \
--output-document "-" \
--timeout=2 \
http://localhost:8080/subversion/${UUID}/notifyCommit?rev=$REV

To test if your post commit is working you can temporarily change it's contents into:

#!/bin/sh
/bin/echo "$REPOS $REV $UUID" >> /var/subversion/svn-post-commit.out

To call the subversion jenkins plugin normally this should work (but it also did not :-))

curl --data "rev=4" http://localhost:8080/subversion/c8bb87ec-9a19-4975-ab9d-8b15741e6d7e/notifyCommit

Check if a file is created and has content in: /var/subversion/svn-post-commit.out
So what worked for me? I just manually invoke jenkins's cli.jar. So I changed the post-commit content into:

#!/bin/sh

/usr/bin/java -jar /usr/share/jenkins/cli/java/cli.jar -s http://localhost:8080/ build yourProject

*Note: Make sure that www-data user has permission to execute cli.jar.




- Committing The Source Code On Github
Slack Discussion Repositories https://github.com/terawarehouse/terawarehouse-cataloghttps://github.com/terawarehouse/terawarehouse-reactTo commit our project in Github, make sure you already created a new Github repository and then: Get the repository...

- Install Jenkins On Ubuntu
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - Then add the following entry in your /etc/apt/sources.list: deb https://pkg.jenkins.io/debian-stable binary/ sudo apt-get update sudo apt-get install jenkins sudo usermod...

- Operating Systems
How to show all startup items in Ubuntu 12.04How to install artifactory and jenkins on ubuntu 12.04How to dual boot Windows 7 and Ubuntu 12.04 on Lenovo G480How to setup an OpenVPN client on an Ubuntu machineHow to setup a DNS Server on ubuntu 12.04How...

- How To Install Artifactory And Jenkins On Ubuntu 12.04
This page is a summary of commands that need to be executed in order to install and setup artifactory and jenkins on Ubuntu 12.04. Install artifactory 1.) Download the zipped file from artifactory: >wget http://sourceforge.net/projects/artifactory/files/artifactory/2.6.4/artifactory-2.6.4.zip...

- How To Install Subversion And Websvn On Ubuntu 12.04
This write-up contains a set of instruction on how to install and configure svn as well as setup websvn on an ubuntu 12.04 machine. 1.) Install subversion and apache2 sudo apt-get install subversion sudo apt-get install apache2 sudo apt-get install libapache2-svn...



Tech-Today








.