algorithm
1. ~/.subversion/config on the glassfish server - allow to store passwords & auth-creds
2. create directory for main trunk - ~/pretest as example (mkdir ~/pretest) - this path also used later in post build action
cd ~/pretest
chekout -
svn checkout https://Maxus.ksf:8443/svn/test_prebuild/trunk/main .
3. create jenkins job
SCM - Subversion + Poll SCM (*/2 * * * * - every 2 minutes for example)
check svn every 2 minutes and run job if changes detected
4. Post build action for job - Post build task with sets Run script only if all previous steps were successful & Escalate script execution status to job status
#!/bin/bash
svn copy . https://Maxus.ksf:8443/svn/test_prebuild/tags/$JOB_NAME-$BUILD_NUMBER -m "Jenkins commit job $JOB_NAME build $BUILD_NUMBER"
rsync -av --exclude=*.svn* . ~/pretest
cd ~/pretest
svn add * --force
svn commit -m "Jenkins commit job $JOB_NAME build $BUILD_NUMBER"
cd $WORKSPACE
In this example every successfull build create svn tag with name like $JOB_NAME-$BUILD_NUMBER
then sync work copy with main trunk directory (~/pretest in our example), change work directory
add all new files & directory to the trunk svn if any
commit to the trunk with comment "Jenkins commit job $JOB_NAME build $BUILD_NUMBER"
Mac on first job run ask in popup desktop question - allow java to use keychains or not
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks
http://sin.tigris.org/Sin%20-%20Continuous%20Integration%20Rethought.html
pre-build test svn
https://maxus.ksf:8443/svn/test_prebuild/
andrey / 4ndr3y
http://blogs.wandisco.com/2012/01/31/polling-subversion-with-jenkins/
svn post commit hook
https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin
thinking
svn swith to the trunk
svn switch http://svn.example.com/repos/calc/branches/my-calc-branch
#svn merge --reintegrate http://svn.example.com/repos/calc/branches/my-calc-branch
svn merge -r 100:HEAD http://svn.example.com/repos/trunk my-working-copy
svn commit -m "Merge my-calc-branch back into trunk!"
cd calc/trunk (switch)
svn update
svn merge -r 341:405 http://svn.example.com/repos/calc/branches/my-calc-branch
svn commit -m "Merged my-calc-branch changes r341:405 into the trunk."
copy svn without svn to another directory
rsync -av --exclude=*.svn* . ~/pretest
add all new file recursively to the svn
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
svn add * --force
get latest svn release number
svnversion .
svn log -r 23
get svnversion as variable - aa=$(svnversion .) echo $aa
visualsvn troubles with tls
http://www.visualsvn.com/support/topic/00056/
centos java repo
cat > /etc/yum.repos.d/jpackage-generic-free.repo << EOF
[jpackage-generic-free]
name=JPackage generic free
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/free/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF
cat > /etc/yum.repos.d/jpackage-generic-devel.repo << EOF
[jpackage-generic-devel]
name=JPackage Generic Developer
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/devel/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF