From 82355cd46effa7184ab7a7c680ce6ec2c6ed2268 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Wed, 5 Jul 2017 16:26:44 -0500 Subject: [PATCH] adds new ceph-medic-release job This job will be used to make repos we can host on download.ceph.com Signed-off-by: Andrew Schoen --- ceph-medic-release/build/build_rpm | 42 ++++++++ .../config/definitions/ceph-medic-release.yml | 95 +++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 ceph-medic-release/build/build_rpm create mode 100644 ceph-medic-release/config/definitions/ceph-medic-release.yml diff --git a/ceph-medic-release/build/build_rpm b/ceph-medic-release/build/build_rpm new file mode 100644 index 00000000..33da1d39 --- /dev/null +++ b/ceph-medic-release/build/build_rpm @@ -0,0 +1,42 @@ +#!/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} diff --git a/ceph-medic-release/config/definitions/ceph-medic-release.yml b/ceph-medic-release/config/definitions/ceph-medic-release.yml new file mode 100644 index 00000000..2deb4dcb --- /dev/null +++ b/ceph-medic-release/config/definitions/ceph-medic-release.yml @@ -0,0 +1,95 @@ +- 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 -- 2.39.5