From: Andrew Schoen Date: Wed, 21 Jun 2017 16:12:12 +0000 (-0500) Subject: ceph-medic-rpm: a job to build rpms for every branch of ceph-medic X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F747%2Fhead;p=ceph-build.git ceph-medic-rpm: a job to build rpms for every branch of ceph-medic Signed-off-by: Andrew Schoen --- diff --git a/ceph-medic-rpm/build/build b/ceph-medic-rpm/build/build new file mode 100644 index 00000000..1f642545 --- /dev/null +++ b/ceph-medic-rpm/build/build @@ -0,0 +1,45 @@ +#!/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[@]" + +# ask shaman which chacra instance to use +chacra_url=`curl -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/` +# create the .chacractl config file using global variables +make_chacractl_config $chacra_url + +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-rpm/config/definitions/ceph-medic-rpm.yml b/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml new file mode 100644 index 00000000..594849cd --- /dev/null +++ b/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml @@ -0,0 +1,44 @@ +- job: + name: ceph-medic-rpm + node: 'centos7 && x86_64 && small && !sepia' + project-type: freestyle + defaults: global + disabled: false + display-name: 'ceph-medic: RPMs' + description: 'Build RPMs for every ceph-medic Git branch' + concurrent: true + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph-medic + discard-old-builds: true + logrotate: + daysToKeep: 1 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + triggers: + - github + + scm: + - git: + url: https://github.com/ceph/ceph-medic + browser: auto + skip-tag: true + timeout: 20 + wipe-workspace: true + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build + + wrappers: + - inject-passwords: + global: true + mask-password-params: true