Add Jenkins job to build RPMs 83/42083/6
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 19 Jul 2016 18:29:09 +0000 (14:29 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Tue, 19 Jul 2016 20:47:55 +0000 (16:47 -0400)
Add job that accepts params that define an RPM build and uses
Int/Pack's build.py script to build an ODL RPM.

Change-Id: I51ee7db2f04a39a4bbc771a223cafced8446b5ca
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
jjb/packaging/include-raw-build-rpm.sh [new file with mode: 0644]
jjb/packaging/packaging.yaml

diff --git a/jjb/packaging/include-raw-build-rpm.sh b/jjb/packaging/include-raw-build-rpm.sh
new file mode 100644 (file)
index 0000000..95a4497
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Options:
+#   -x: Echo commands
+#   -e: Fail on errors
+#   -o pipefail: Fail on errors in scripts this calls, give stacktrace
+set -ex -o pipefail
+
+# Install required packages
+virtualenv rpm_build
+source rpm_build/bin/activate
+pip install --upgrade pip
+pip install -r $WORKSPACE/packaging/rpm/requirements.txt
+
+# Build release specified by build params
+$WORKSPACE/packaging/rpm/build.py --major "$VERSION_MAJOR" \
+                                  --minor "$VERSION_MINOR" \
+                                  --patch "$VERSION_PATCH" \
+                                  --rpm "$RPM_RELEASE" \
+                                  --sysd_commit "$SYSD_COMMIT" \
+                                  --codename "$CODENAME" \
+                                  --download_url "$DOWNLOAD_URL" \
+                                  --changelog_date "$CHANGELOG_DATE" \
+                                  --changelog_name "$CHANGELOG_NAME" \
+                                  --changelog_email "$CHANGELOG_EMAIL"
index f3d1a6a6f9e204e59242c3664f101b90ebc8e2be..11b26319e368b701bb1020bfca39020be09ce690 100644 (file)
@@ -1,11 +1,74 @@
 - project:
     name: packaging
+    project-name: packaging
+
     jobs:
         - '{project-name}-verify-python-{stream}'
+        - '{project-name}-build-rpm-{stream}'
+
+    project: 'integration/packaging'
 
     stream:
         - master:
             branch: 'master'
 
-    project: 'integration/packaging'
-    project-name: 'packaging'
+- job-template:
+    name: '{project-name}-build-rpm-{stream}'
+
+    node: dynamic_verify
+
+    parameters:
+        - opendaylight-infra-parameters:
+            project: '{project}'
+            branch: '{branch}'
+            refspec: 'refs/heads/{branch}'
+            artifacts: 'rpm/cache/*.srpm rpm/cache/*.rpm'
+        - string:
+            name: VERSION_MAJOR
+            default: '4'
+            description: 'OpenDaylight major (element) version number to build'
+        - string:
+            name: VERSION_MINOR
+            default: '2'
+            description: 'OpenDaylight minor (SR) version number to build'
+        - string:
+            name: VERSION_PATCH
+            default: '0'
+            description: 'OpenDaylight patch version to build'
+        - string:
+            name: RPM_RELEASE
+            default: '1'
+            description: 'RPM version for the given ODL major.minor.patch'
+        - string:
+            name: SYSD_COMMIT
+            default: 'c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed'
+            description: 'Version of ODL systemd unitfile to download and package in ODL RPM'
+        - string:
+            name: CODENAME
+            default: 'Beryllium-SR2'
+            description: 'Elemental codename for the ODL release, including SR if applicable'
+        - string:
+            name: DOWNLOAD_URL
+            default: 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.2-Beryllium-SR2/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz'
+            description: 'URL to ODL tarball artifact to repackage into RPM'
+        - string:
+            name: CHANGELOG_DATE
+            default: 'Wed May 11 2016'
+            description: 'Date this RPM was defined'
+        - string:
+            name: CHANGELOG_NAME
+            default: 'Jenkins'
+            description: 'Name of person who defined RPM'
+        - string:
+            name: CHANGELOG_EMAIL
+            default: 'jenkins-donotreply@opendaylight.org'
+            description: 'Email of person who defined RPM'
+
+    scm:
+        - integration-gerrit-scm:
+            basedir: 'packaging'
+            refspec: '$GERRIT_REFSPEC'
+            branch: 'master'
+
+    builders:
+        - shell: !include-raw: include-raw-build-rpm.sh