JJB jobs for the OpFlex project 12/27712/3
authorRob Adams <readams@readams.net>
Thu, 1 Oct 2015 00:54:19 +0000 (17:54 -0700)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 12 Nov 2015 21:45:32 +0000 (16:45 -0500)
- Create jobs that can generate RPMs for libuv, rapidjson, and
  openvswitch-lib using mock, though these are current not functional
  until mock is added to the base image
- Create jobs that can generate tgz packages that for libuv,
  rapidjson, and openvswitch that can install into a temporary prefix.
- Create opflex-verify and opflex-merge jobs that can build opflex
  using the dependency tgz packages.

Change-Id: Icdb1f26ec59a32a1c5ac72bfd35fa0abe0ff9996
Also-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Rob Adams <readams@readams.net>
jjb/opflex/include-raw-libuv_tgz-build.sh [new file with mode: 0644]
jjb/opflex/include-raw-openvswitch_tgz-build.sh [new file with mode: 0644]
jjb/opflex/include-raw-opflex-build.sh [new file with mode: 0644]
jjb/opflex/include-raw-opflex-dep_rpm-build.sh [new file with mode: 0644]
jjb/opflex/include-raw-ovs_rpm-build.sh [new file with mode: 0644]
jjb/opflex/include-raw-rapidjson_tgz-build.sh [new file with mode: 0644]
jjb/opflex/opflex-custom.yaml [new file with mode: 0644]
jjb/opflex/opflex-dependencies-rpm.yaml [new file with mode: 0644]
jjb/opflex/opflex-dependencies.yaml [new file with mode: 0644]

diff --git a/jjb/opflex/include-raw-libuv_tgz-build.sh b/jjb/opflex/include-raw-libuv_tgz-build.sh
new file mode 100644 (file)
index 0000000..54130ed
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+set -x
+
+./autogen.sh
+ROOT=/tmp/opflex-prefix
+./configure --prefix=$ROOT
+mkdir install-root
+DESTDIR=`pwd`/install-root make clean install
+pushd install-root
+tar -czf libuv.tgz *
+popd
diff --git a/jjb/opflex/include-raw-openvswitch_tgz-build.sh b/jjb/opflex/include-raw-openvswitch_tgz-build.sh
new file mode 100644 (file)
index 0000000..a0d2e10
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Build script for openvswitch
+
+set -e
+set -x
+
+ROOT=/tmp/opflex-prefix
+DESTDIR=install-root
+
+mkdir -p "$DESTDIR"
+
+./boot.sh
+./configure --prefix="$ROOT" --enable-shared
+make -j8
+DESTDIR=`pwd`/$DESTDIR make install
+find lib ofproto -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
+
+pushd $DESTDIR
+tar -czf openvswitch.tgz *
diff --git a/jjb/opflex/include-raw-opflex-build.sh b/jjb/opflex/include-raw-opflex-build.sh
new file mode 100644 (file)
index 0000000..8e56a5d
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Build script for opflex
+
+set -e
+set -x
+
+ROOT=/tmp/opflex-prefix
+
+function cleanup {
+    if [ -d "$ROOT" ]; then rm -rf "$ROOT"; fi
+}
+
+# create dependency root prefix
+cleanup
+mkdir -p "$ROOT"
+trap cleanup EXIT
+
+tar -xz -C "$ROOT" --strip-components=2 -f libuv.tgz
+tar -xz -C "$ROOT" --strip-components=2 -f rapidjson.tgz
+tar -xz -C "$ROOT" --strip-components=2 -f openvswitch.tgz
+
+export PATH="$ROOT/bin:$PATH"
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ROOT/lib"
+export PKG_CONFIG_PATH="$ROOT/lib/pkgconfig"
+
+# build libopflex
+pushd libopflex
+./autogen.sh
+./configure --prefix="$ROOT" \
+    --with-buildversion=$BUILD_NUMBER \
+    CPPFLAGS="-isystem $ROOT/include"
+    CXXFLAGS="-Wall"
+make -j8
+make check
+make install
+make dist
+popd
+
+# build libmodelgbp
+pushd genie
+CLASSPATH=target/classes java org.opendaylight.opflex.genie.Genie
+pushd target/libmodelgbp
+bash autogen.sh
+./configure --prefix="$ROOT"
+make -j2
+make install
+make dist
+popd
+popd
+
+# build agent-ovs
+pushd agent-ovs
+./autogen.sh
+./configure --prefix="$ROOT" \
+    --with-buildversion=$BUILD_NUMBER \
+    CPPFLAGS="-isystem $ROOT/include" \
+    CXXFLAGS="-Wall"
+make -j8
+make check
+make dist
+popd
diff --git a/jjb/opflex/include-raw-opflex-dep_rpm-build.sh b/jjb/opflex/include-raw-opflex-dep_rpm-build.sh
new file mode 100644 (file)
index 0000000..63aa052
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+set -x
+
+LIBUV_VERSION=1.5.0
+wget https://github.com/libuv/libuv/archive/v$LIBUV_VERSION.tar.gz
+mock --define="buildversion $BUILD_NUMBER" -r $MOCK_TARGET --resultdir target/srpm --buildsrpm --spec libuv.spec --sources v$LIBUV_VERSION.tar.gz
+
+RAPIDJSON_VERSION=1.0.2
+wget https://github.com/miloyip/rapidjson/archive/v$RAPIDJSON_VERSION.tar.gz
+mock --define="buildversion $BUILD_NUMBER" -r $TARGET --resultdir target/srpm --buildsrpm --spec rapidjson-devel.spec --sources v$RAPIDJSON_VERSION.tar.gz
+
+mockchain -m --define="buildversion $BUILD_NUMBER" -r $MOCK_TARGET -l target/rpm target/srpm/*.src.rpm
+find target/rpm/results -name "*.rpm" -exec mv {} . \;
diff --git a/jjb/opflex/include-raw-ovs_rpm-build.sh b/jjb/opflex/include-raw-ovs_rpm-build.sh
new file mode 100644 (file)
index 0000000..9dbe487
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Build OVS RPMs
+
+set -e
+set -x
+
+TARGET=epel-7-x86_64
+BASEKERNEL=3.10.0-229.14.1.el7.x86_64
+BVDEFINE=--define="buildversion $BUILD_NUMBER"
+KMDEFINE=--define="kversion $BASEKERNEL"
+
+./boot.sh
+./configure
+make dist
+
+SOURCE_FILE=$(ls *.tar.gz)
+
+mock -r $TARGET --resultdir target/srpm --buildsrpm --spec rhel/openvswitch-gbp-rhel.spec --sources $SOURCE_FILE "$BVDEFINE" "$KMDEFINE"
+mock -r $TARGET --resultdir target/srpm --buildsrpm --spec rhel/openvswitch-gbp-kmod-rhel.spec --sources $SOURCE_FILE "$BVDEFINE" "$KMDEFINE"
+mockchain -r $TARGET -l target/rpm -m --nocheck -m "$BVDEFINE" -m "$KMDEFINE" target/srpm/*.src.rpm
+
+find target/rpm/results -name "*.rpm" -exec mv {} . \;
diff --git a/jjb/opflex/include-raw-rapidjson_tgz-build.sh b/jjb/opflex/include-raw-rapidjson_tgz-build.sh
new file mode 100644 (file)
index 0000000..e173dc8
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Build script for rapidjson
+
+set -e
+set -x
+
+ROOT=/tmp/opflex-prefix
+DESTDIR=install-root
+
+mkdir -p "$DESTDIR/$ROOT/lib/pkgconfig"
+mkdir -p "$DESTDIR/$ROOT/include"
+
+cp -R include/rapidjson "$DESTDIR/$ROOT/include"
+sed -e "s|@INCLUDE_INSTALL_DIR@|$ROOT/include|" \
+    -e "s|@PROJECT_NAME@|RapidJSON|" \
+    -e "s|@LIB_VERSION_STRING@|1.0.1|" RapidJSON.pc.in > \
+    "$DESTDIR/$ROOT/lib/pkgconfig/RapidJSON.pc"
+
+pushd $DESTDIR
+tar -czf rapidjson.tgz *
diff --git a/jjb/opflex/opflex-custom.yaml b/jjb/opflex/opflex-custom.yaml
new file mode 100644 (file)
index 0000000..6e26c44
--- /dev/null
@@ -0,0 +1,140 @@
+- project:
+    name: opflex
+    jobs:
+        - 'opflex-verify-{stream}'
+        - 'opflex-merge-{stream}'
+#        - 'opflex-daily-{stream}'
+#        - 'opflex-distribution-{stream}'
+
+    # stream:    release stream (eg. stable-lithium or beryllium)
+    # branch:    git branch (eg. stable/lithium or master)
+    stream:
+        - beryllium:
+            branch: 'master'
+            jdk: openjdk7
+            jdks:
+                - openjdk7
+
+    project: 'opflex'
+
+- builder:
+    name: opflex-build
+    builders:
+      - maven-target:
+          maven-version: '{mvn33}'
+          pom: genie/pom.xml
+          goals: compile
+      - copyartifact:
+          project: opflex-libuv_tgz-{stream}
+          flatten: true
+      - copyartifact:
+          project: opflex-rapidjson_tgz-{stream}
+          flatten: true
+      - copyartifact:
+          project: opflex-openvswitch_tgz-{stream}
+          flatten: true
+      - shell:
+          !include-raw-escape include-raw-opflex-build.sh
+
+- job-template:
+    name: 'opflex-verify-{stream}'
+
+    project-type: matrix
+    node: matrix_master
+    concurrent: true
+
+    axes:
+        - axis:
+            type: slave
+            name: nodes
+            values:
+                - dynamic_verify
+        - axis:
+            type: jdk
+            values: '{obj:jdks}'
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - gerrit-refspec-parameter:
+            refspec: ''
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: '$GERRIT_REFSPEC'
+            choosing-strategy: 'gerrit'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    triggers:
+        - gerrit-trigger-patch-submitted:
+            name: 'opflex'
+            branch: '{branch}'
+
+    builders:
+        - opflex-build:
+            mvn33: '{mvn33}'
+            stream: '{stream}'
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+
+- job-template:
+    name: 'opflex-merge-{stream}'
+
+    node: dynamic_merge
+    jdk: '{jdk}'
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    triggers:
+        - gerrit-trigger-patch-merged:
+            name: 'opflex'
+            branch: '{branch}'
+
+    builders:
+        - opflex-build:
+            mvn33: '{mvn33}'
+            stream: '{stream}'
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: '**/*.tar.gz'
diff --git a/jjb/opflex/opflex-dependencies-rpm.yaml b/jjb/opflex/opflex-dependencies-rpm.yaml
new file mode 100644 (file)
index 0000000..6790500
--- /dev/null
@@ -0,0 +1,101 @@
+- project:
+    name: opflex-dependencies-rpm
+    jobs:
+        - 'opflex-dep_rpm-{stream}'
+        - 'opflex-openvswitch_rpm-{stream}'
+
+    stream:
+        - beryllium:
+            branch: 'master'
+            jdk: openjdk7
+            jdks:
+                - openjdk7
+
+    project: 'opflex'
+
+- parameter:
+    name: mock-target-parameter
+    parameters:
+        - string:
+            name: MOCK_TARGET
+            default: 'epel-7-x86_64'
+            description: "Target architecture for mock RPM builds"
+
+- scm:
+    name: 'git-opflex-3rdparty'
+    scm:
+        - git:
+            url: https://github.com/noironetworks/3rdparty-rpm.git
+            branches:
+                - 'origin/master'
+            wipe-workspace: true
+
+- job-template:
+    name: 'opflex-dep_rpm-{stream}'
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    scm:
+        - git-opflex-3rdparty
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    parameters:
+        - mock-target-parameter
+
+    builders:
+        - shell:
+            !include-raw-escape include-raw-opflex-dep_rpm-build.sh
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: '*.rpm'
+
+- job-template:
+    name: 'opflex-openvswitch_rpm-{stream}'
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    scm:
+        - git-opflex-ovs
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    parameters:
+        - mock-target-parameter
+
+    builders:
+        - shell:
+            !include-raw-escape include-raw-ovs_rpm-build.sh
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: '*.rpm'
diff --git a/jjb/opflex/opflex-dependencies.yaml b/jjb/opflex/opflex-dependencies.yaml
new file mode 100644 (file)
index 0000000..1b09200
--- /dev/null
@@ -0,0 +1,148 @@
+- project:
+    name: opflex-dependencies
+    jobs:
+        - 'opflex-libuv_tgz-{stream}'
+        - 'opflex-rapidjson_tgz-{stream}'
+        - 'opflex-openvswitch_tgz-{stream}'
+
+    stream:
+        - beryllium:
+            branch: 'master'
+            jdk: openjdk7
+            jdks:
+                - openjdk7
+
+    project: 'opflex'
+
+- scm:
+    name: 'git-opflex-libuv'
+    scm:
+        - git:
+            url: https://github.com/libuv/libuv.git
+            branches:
+                - 'refs/tags/v1.7.5'
+            wipe-workspace: true
+
+- scm:
+    name: 'git-opflex-rapidjson'
+    scm:
+        - git:
+            url: https://github.com/miloyip/rapidjson.git
+            branches:
+                - 'refs/tags/v1.0.1'
+            wipe-workspace: true
+
+- scm:
+    name: 'git-opflex-ovs'
+    scm:
+        - git:
+            url: https://github.com/noironetworks/ovs.git
+            branches:
+                - 'origin/noiro'
+            wipe-workspace: true
+
+- job-template:
+    name: 'opflex-libuv_tgz-{stream}'
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    scm:
+        - git-opflex-libuv
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    builders:
+        - shell:
+            !include-raw-escape include-raw-libuv_tgz-build.sh
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: 'install-root/*.tgz'
+
+- job-template:
+    name: 'opflex-rapidjson_tgz-{stream}'
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    scm:
+        - git-opflex-rapidjson
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    builders:
+        - shell:
+            !include-raw-escape include-raw-rapidjson_tgz-build.sh
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: 'install-root/*.tgz'
+
+- job-template:
+    name: 'opflex-openvswitch_tgz-{stream}'
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
+
+    axes:
+        - axis:
+            type: slave
+            name: nodes
+            values:
+                - dynamic_verify
+        - axis:
+            type: jdk
+            values: '{obj:jdks}'
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    scm:
+        - git-opflex-ovs
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    builders:
+        - shell:
+            !include-raw-escape include-raw-openvswitch_tgz-build.sh
+
+    publishers:
+        - email-notification:
+            email-prefix: '[opflex]'
+        - archive:
+            artifacts: 'install-root/*.tgz'