--- /dev/null
+#!/bin/bash
+
+set -ex
+
+# Sanity-check:
+[ -z "$GIT_BRANCH" ] && echo Missing GIT_BRANCH variable && exit 1
+[ -z "$JOB_NAME" ] && echo Missing JOB_NAME variable && exit 1
+
+# Strip "-rpm" off the job name to get our package's name
+PACKAGE=${JOB_NAME%-rpm}
+
+sudo yum -y install epel-release
+sudo yum -y install fedpkg mock
+
+# Add the Jenkins slave UID to the mock group.
+sudo usermod -a -G mock $(whoami)
+newgrp mock
+
+# Attempt the build. If it fails, print the mock logs to STDOUT.
+make rpm || ( tail -n +1 {root,build}.log && exit 1 )
+
+# Chacra time
+
+pkgs=( "chacractl>=0.0.4" )
+install_python_packages "pkgs[@]"
+
+make_chacractl_config
+
+BRANCH=`branch_slash_filter $GIT_BRANCH`
+
+## Upload the created RPMs to chacra
+chacra_endpoint="${PACKAGE}/${BRANCH}/${GIT_COMMIT}/centos/7"
+
+[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""
+
+# push binaries to chacra
+ls *.rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/noarch/
+
+# start repo creation
+$VENV/chacractl repo update ${chacra_endpoint}
+
+echo Check the status of the repo at: https://shaman.ceph.com/api/repos/${chacra_endpoint}
--- /dev/null
+- job:
+ name: ceph-medic-release
+ project-type: matrix
+ defaults: global
+ display-name: 'ceph-medic-release'
+ block-downstream: false
+ block-upstream: false
+ concurrent: true
+ properties:
+ - github:
+ url: https://github.com/ceph/ceph-medic
+ parameters:
+ - string:
+ name: BRANCH
+ description: "The git branch (or tag) to build"
+ default: "master"
+
+ - string:
+ name: DISTROS
+ description: "A list of distros to build for. Available options are: centos7, centos6"
+ default: "centos7"
+
+ - string:
+ name: ARCHS
+ description: "A list of architectures to build for. Available options are: x86_64, and arm64"
+ default: "x86_64"
+
+ - bool:
+ name: FORCE
+ description: "
+If this is unchecked, then nothing is built or pushed if they already exist in chacra. This is the default.
+
+If this is checked, then the binaries will be built and pushed to chacra even if they already exist in chacra."
+
+ - string:
+ name: BUILD_VIRTUALENV
+ description: "Base parent path for virtualenv locations, set to avoid issues with extremely long paths that are incompatible with tools like pip. Defaults to '/tmp/' (note the trailing slash, which is required)."
+ default: "/tmp/"
+
+ execution-strategy:
+ combination-filter: DIST==AVAILABLE_DIST && ARCH==AVAILABLE_ARCH && (ARCH=="x86_64" || (ARCH == "arm64" && (DIST == "xenial" || DIST == "centos7")))
+ axes:
+ - axis:
+ type: label-expression
+ name: MACHINE_SIZE
+ values:
+ - small
+ - axis:
+ type: label-expression
+ name: AVAILABLE_ARCH
+ values:
+ - x86_64
+ - arm64
+ - axis:
+ type: label-expression
+ name: AVAILABLE_DIST
+ values:
+ - centos7
+ - xenial
+ - axis:
+ type: dynamic
+ name: DIST
+ values:
+ - DISTROS
+ - axis:
+ type: dynamic
+ name: ARCH
+ values:
+ - ARCHS
+
+ scm:
+ - git:
+ url: https://github.com/ceph/ceph-medic
+ # Use the SSH key attached to the ceph-jenkins GitHub account.
+ skip-tag: true
+ branches:
+ - $BRANCH
+ wipe-workspace: false
+
+ builders:
+ - shell: |
+ echo "Cleaning up top-level workarea (shared among workspaces)"
+ sudo rm -rf dist
+ sudo rm -rf venv
+ sudo rm -rf release
+ # rpm build scripts
+ - shell:
+ !include-raw:
+ - ../../../scripts/build_utils.sh
+ - ../../build/build_rpm
+
+ wrappers:
+ - inject-passwords:
+ global: true
+ mask-password-params: true