]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
script to update jenkins scripts on sagunt
authorHolger Levsen <holger@layer-acht.org>
Sat, 9 Mar 2013 22:39:52 +0000 (23:39 +0100)
committerHolger Levsen <holger@layer-acht.org>
Sat, 9 Mar 2013 22:39:52 +0000 (23:39 +0100)
pb_update_jenkins [new file with mode: 0755]

diff --git a/pb_update_jenkins b/pb_update_jenkins
new file mode 100755 (executable)
index 0000000..0ab8c32
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# copyright 2013 Holger Levsen <holger@layer-acht.org>
+# GPL2 licenced
+
+# this needs to be copied to /usr/local/bin (until this is packaged...)
+
+set -e
+
+WHOAMI=$(whoami 2>/dev/null)
+if [ "$WHOAMI" != "jenkins" ] ; then
+       sudo -u jenkins -i $0
+       exit 0
+fi
+
+id
+cd 
+cd jenkins_build_script/develop/ 
+git pull origin develop 
+git fetch -fp 
+cd ../master 
+git pull origin master 
+git fetch -fp
+
+echo "Update successful."