]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Add mariner-installer job 117/head
authorTravis Rhoden <trhoden@redhat.com>
Mon, 31 Aug 2015 20:20:08 +0000 (13:20 -0700)
committerTravis Rhoden <trhoden@redhat.com>
Mon, 31 Aug 2015 22:36:03 +0000 (15:36 -0700)
Start building upstream packages for
https://github.com/ceph/mariner-installer

Signed-off-by: Travis Rhoden <trhoden@redhat.com>
mariner-installer/build/build [new file with mode: 0644]
mariner-installer/config/definitions/mariner-installer.yml [new file with mode: 0644]

diff --git a/mariner-installer/build/build b/mariner-installer/build/build
new file mode 100644 (file)
index 0000000..d125bc7
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash -ex
+
+echo "BRANCH: $BRANCH"
+cd $WORKSPACE/mariner-installer
+
+# FIXME A very naive way to just list the RPM $DIST that we currently support.
+# We should be a bit more lenient to allow any rhel/centos/sles/suse
+rpm_dists="rhel centos6.5 centos7 rhel6.5 rhel7 centos sles11sp2 opensuse12.2"
+deb_dists="precise wheezy squeeze trusty"
+
+# A helper to match an item in a list of items, like python's `if item in list`
+listcontains() {
+  for word in $2; do
+    [[ $word = $1 ]] && return 0
+  done
+  return 1
+}
+
+if listcontains $DIST "$deb_dists" ; then
+    DEBIAN=1
+    dpkg-buildpackage -us -uc
+elif listcontains $DIST "$rpm_dists" ; then
+    DEBIAN=0
+    tito build --rpm
+else
+    echo "Can't determine build host type"
+    exit 1
+fi
+
+if [ -n "$BRANCH" ]; then
+    # A user explicitly told Jenkins to build a branch.
+    # (ie, this is not an automatic GitHub pull request build.)
+    # Move the artifacts into position for archiving.
+    cd $WORKSPACE
+    rm -rf $BRANCH
+    mkdir $BRANCH
+
+    if [ $DEBIAN = 1 ] ; then
+        mv *.deb *.dsc *.changes *.tar.gz $BRANCH
+    else
+        find rpmbuild -name '*.rpm' -o -name '*.srpm' | xargs -i mv {} $BRANCH
+    fi
+fi
diff --git a/mariner-installer/config/definitions/mariner-installer.yml b/mariner-installer/config/definitions/mariner-installer.yml
new file mode 100644 (file)
index 0000000..4387ce0
--- /dev/null
@@ -0,0 +1,53 @@
+- job:
+    name: mariner-installer
+    description: Build and package mariner-installer
+    project-type: matrix
+    axes:
+    - axis:
+        name: Arch
+        type: label-expression
+        values:
+        - x86_64
+    - axis:
+        name: Dist
+        type: label-expression
+        values:
+        - trusty
+    block-downstream: false
+    block-upstream: false
+
+    properties:
+    - github:
+        url: https://github.com/ceph/mariner-installer/
+
+    scm:
+    - git:
+        skip-tag: true
+        basedir: mariner-installer
+        url: https://github.com/ceph/mariner-installer
+        branches:
+         - $BRANCH
+
+    execution-strategy:
+      run-sequentially: false
+
+    builders:
+    - shell:
+        !include-raw ../../build/build
+    concurrent: false
+    parameters:
+    - string:
+        default: master
+        description: 'The git branch or tag to build'
+        name: BRANCH
+
+    publishers:
+    - archive:
+        allow-empty: false
+        artifacts: $BRANCH/*
+        default-excludes: true
+        fingerprint: false
+        only-if-success: false
+    - description-setter:
+        regexp: '^BRANCH: (\S+)'
+        set-for-matrix: false