Permalink
Browse files

Add remote build for doing builds without running a jenkins slave

  • Loading branch information...
1 parent 60f68ac commit 13975efaa6c037717c22e1431fdb6803523263ee Mikko Koppanen committed Feb 28, 2011
Showing with 74 additions and 8 deletions.
  1. +16 −8 apisite/apiall
  2. +1 −0 remotebuild/README.md
  3. +28 −0 remotebuild/execbuild.sh
  4. +29 −0 remotebuild/sendbuild.sh
View
24 apisite/apiall
@@ -13,13 +13,21 @@
# zeromq2 - current master and older versions
# zeromq2-1 - 2.1 release
#
-./apione ../../zeromq2 master master
-./apione ../../zeromq2 v2.1.0 2-1-0
-./apione ../../zeromq2 v2.0.10 2-0-10
-./apione ../../zeromq2 v2.0.9 2-0-9
-./apione ../../zeromq2 v2.0.8 2-0-8
-./apione ../../zeromq2 v2.0.7 2-0-7
-./apione ../../zeromq2 v2.0.6 2-0-6
+if test "x$ZEROMQ2_MASTER" = "x"; then
+ ZEROMQ2_MASTER="../../zeromq2"
+fi
+
+if test "x$ZEROMQ2_RELEASE" = "x"; then
+ ZEROMQ2_RELEASE="../../zeromq2-1"
+fi
+
+./apione "$ZEROMQ2_MASTER" master master
+./apione "$ZEROMQ2_MASTER" v2.1.0 2-1-0
+./apione "$ZEROMQ2_MASTER" v2.0.10 2-0-10
+./apione "$ZEROMQ2_MASTER" v2.0.9 2-0-9
+./apione "$ZEROMQ2_MASTER" v2.0.8 2-0-8
+./apione "$ZEROMQ2_MASTER" v2.0.7 2-0-7
+./apione "$ZEROMQ2_MASTER" v2.0.6 2-0-6
# 2.1 is in its own release git
-./apione ../../zeromq2-1 v2.1.1 2-1-1
+./apione "$ZEROMQ2_RELEASE" v2.1.1 2-1-1
View
1 remotebuild/README.md
@@ -0,0 +1 @@
+Coming soon..
View
28 remotebuild/execbuild.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+fail() {
+ echo "Build failed"
+ exit 1
+}
+trap fail ERR
+
+if test "x$1" = "x"; then
+ echo "Usage: $0 <repo url>"
+ exit 1
+fi
+
+if test -d ./build_tmp_dir; then
+ rm -rf ./build_tmp_dir
+fi
+
+# Clone the repository
+git clone $1 ./build_tmp_dir
+cd ./build_tmp_dir
+
+# Prepare build
+./autogen.sh
+./configure
+
+# Build
+make -j2
+make check
View
29 remotebuild/sendbuild.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+if test "x$1" = "x"; then
+ echo "Usage: $0 <git repo>"
+ exit 1
+fi
+
+if test "x$JENKINS_URI" = "x"; then
+ echo "JENKINS_URI must be set"
+ exit 1
+fi
+
+START_TIME=`date +'%s'`
+./execbuild.sh "$1" > ./raw_output.txt 2>&1
+BUILD_STATUS=$?
+BUILD_OUTPUT=`xxd -p ./raw_output.txt | tr -d '\n'`
+END_TIME=`date +'%s'`
+
+ELAPSED_TIME=`expr $END_TIME - $START_TIME`
+ELAPSED_TIME=`expr $ELAPSED_TIME \\* 1000`
+
+echo "<run>
+ <log encoding='hexBinary'>${BUILD_OUTPUT}</log>
+ <result>${BUILD_STATUS}</result>
+ <duration>${ELAPSED_TIME}</duration>
+ </run>" > ./build_output.txt
+
+curl --insecure -X POST --raw --upload-file ./build_output.txt \
+"${JENKINS_URI}/job/${JOB_NAME}/postBuildResult"

0 comments on commit 13975ef

Please sign in to comment.