From: Dan Mick Date: Thu, 5 Dec 2024 08:40:08 +0000 (-0800) Subject: move ceph-medic* and diamond* to attic/ X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7bea65c26c9932074b4d5abae5b9f9d35a798679;p=ceph-build.git move ceph-medic* and diamond* to attic/ long-obsolete jobs Signed-off-by: Dan Mick --- diff --git a/attic/ceph-medic-docs/build/build b/attic/ceph-medic-docs/build/build new file mode 100644 index 00000000..3de81e41 --- /dev/null +++ b/attic/ceph-medic-docs/build/build @@ -0,0 +1,23 @@ +#!/bin/bash + +set -ex + +# the following two methods exist in scripts/build_utils.sh +pkgs=( "tox" ) +TEMPVENV=$(create_venv_dir) +VENV=${TEMPVENV}/bin +install_python_packages $TEMPVENV "pkgs[@]" + +# trims leading slashes +BRANCH=`branch_slash_filter ${GIT_BRANCH}` + +# create the docs build with tox +$VENV/tox -rv -e docs + +# publish docs to http://docs.ceph.com/ceph-medic/$BRANCH/ create +# a `$BRANCH` dir because the project has stable branches that will +# publish docs that might be different from other versions (similar, +# but not exactly the same to what the Ceph project does) +mkdir -p "/var/ceph-medic/docs/$BRANCH" +rsync -auv --delete .tox/docs/tmp/html/* "/var/ceph-medic/docs/$BRANCH/" + diff --git a/attic/ceph-medic-docs/config/definitions/ceph-medic-docs.yml b/attic/ceph-medic-docs/config/definitions/ceph-medic-docs.yml new file mode 100644 index 00000000..6401e934 --- /dev/null +++ b/attic/ceph-medic-docs/config/definitions/ceph-medic-docs.yml @@ -0,0 +1,39 @@ +- job: + name: ceph-medic-docs + node: docs + project-type: freestyle + defaults: global + display-name: 'ceph-medic: docs build' + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - build-discarder: + days-to-keep: -1 + num-to-keep: 10 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + - github: + url: https://github.com/ceph/ceph-medic + + triggers: + - github + + scm: + - git: + url: https://github.com/ceph/ceph-medic + branches: + - main + # as more stable branches are published, they need to be + # added here + #- stable-1.0 + browser: auto + skip-tag: true + timeout: 20 + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build diff --git a/attic/ceph-medic-pull-requests/build/build b/attic/ceph-medic-pull-requests/build/build new file mode 100644 index 00000000..c08420b7 --- /dev/null +++ b/attic/ceph-medic-pull-requests/build/build @@ -0,0 +1,15 @@ +#!/bin/bash + +# the following two methods exist in scripts/build_utils.sh +pkgs=( "tox" ) +TEMPVENV=$(create_venv_dir) +VENV=${TEMPVENV}/bin +install_python_packages $TEMPVENV "pkgs[@]" + +sudo yum install -y epel-release +sudo yum --enablerepo epel install -y python36 + +cd "$WORKSPACE/ceph-medic" + +export TOX_SKIP_ENV=py37 +$VENV/tox -rv diff --git a/attic/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml b/attic/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml new file mode 100644 index 00000000..1f04dafc --- /dev/null +++ b/attic/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml @@ -0,0 +1,64 @@ +- scm: + name: ceph-medic + scm: + - git: + url: https://github.com/ceph/ceph-medic + branches: + - ${sha1} + refspec: +refs/pull/*:refs/remotes/origin/pr/* + browser: auto + timeout: 20 + basedir: "ceph-medic" + skip-tag: true + wipe-workspace: true + + +- job: + name: ceph-medic-pull-requests + description: Runs tox tests for ceph-medic on each GitHub PR + project-type: freestyle + node: python3 && centos7 + block-downstream: false + block-upstream: false + defaults: global + display-name: 'ceph-medic: Pull Requests' + quiet-period: 5 + retry-count: 3 + + + properties: + - build-discarder: + days-to-keep: 15 + num-to-keep: 30 + artifact-days-to-keep: 15 + artifact-num-to-keep: 15 + - github: + url: https://github.com/ceph/ceph-medic/ + + parameters: + - string: + name: sha1 + description: "A pull request ID, like 'origin/pr/72/head'" + + triggers: + - github-pull-request: + admin-list: + - dmick + - ktdreyer + - andrewschoen + - zmc + org-list: + - ceph + only-trigger-phrase: false + github-hooks: true + permit-all: true + auto-close-on-fail: false + + scm: + - ceph-medic + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build diff --git a/attic/ceph-medic-release/build/build_rpm b/attic/ceph-medic-release/build/build_rpm new file mode 100644 index 00000000..fa3f8e24 --- /dev/null +++ b/attic/ceph-medic-release/build/build_rpm @@ -0,0 +1,38 @@ +#!/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 + + +sudo yum -y install epel-release +sudo yum -y install fedpkg 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.21" ) +TEMPVENV=$(create_venv_dir) +VENV=${TEMPVENV}/bin +install_python_packages $TEMPVENV "pkgs[@]" + +make_chacractl_config + +BRANCH=`branch_slash_filter $GIT_BRANCH` + +## Upload the created RPMs to chacra +chacra_endpoint="ceph-medic/${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/attic/ceph-medic-release/config/definitions/ceph-medic-release.yml b/attic/ceph-medic-release/config/definitions/ceph-medic-release.yml new file mode 100644 index 00000000..3dea2239 --- /dev/null +++ b/attic/ceph-medic-release/config/definitions/ceph-medic-release.yml @@ -0,0 +1,99 @@ +- 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: "main" + + - 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 + - bionic + - axis: + type: dynamic + name: DIST + values: + - DISTROS + - axis: + type: dynamic + name: ARCH + values: + - ARCHS + + scm: + - git: + url: https://github.com/ceph/ceph-medic + 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 + - credentials-binding: + - text: + credential-id: chacractl-key + variable: CHACRACTL_KEY diff --git a/attic/ceph-medic-rpm/build/build b/attic/ceph-medic-rpm/build/build new file mode 100644 index 00000000..46be3f83 --- /dev/null +++ b/attic/ceph-medic-rpm/build/build @@ -0,0 +1,43 @@ +#!/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 + +# 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.21" ) +TEMPVENV=$(create_venv_dir) +VENV=${TEMPVENV}/bin +install_python_packages $TEMPVENV "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/attic/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml b/attic/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml new file mode 100644 index 00000000..3b5111c2 --- /dev/null +++ b/attic/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml @@ -0,0 +1,48 @@ +- 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: + - build-discarder: + days-to-keep: 1 + num-to-keep: 10 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + - github: + url: https://github.com/ceph/ceph-medic + discard-old-builds: true + + 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 + - credentials-binding: + - text: + credential-id: shaman-api-key + variable: SHAMAN_API_KEY diff --git a/attic/diamond-build/build/build_deb b/attic/diamond-build/build/build_deb new file mode 100644 index 00000000..103644ac --- /dev/null +++ b/attic/diamond-build/build/build_deb @@ -0,0 +1,79 @@ +#!/bin/bash +set -ex + +# Only do actual work when we are a DEB distro +if test -f /etc/redhat-release ; then + exit 0 +fi + +cd $WORKSPACE + +# slap -rc to the ref if we are doing a release-candidate build +chacra_ref="$BRANCH" +[ "$RC" = true ] && chacra_ref="$BRANCH-rc" +[ "$TEST" = true ] && chacra_ref="test" + +ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH) +DISTRO="" +case $DIST in + jessie|wheezy) + DISTRO="debian" + ;; + *) + DISTRO="ubuntu" + ;; +esac + +debian_version=${VERSION}-1 + +BPVER=`gen_debian_version $debian_version $DIST` + +chacra_endpoint="diamond/${BRANCH}/${SHA1}/${DISTRO}/${DIST}" +chacra_check_url="${chacra_endpoint}/diamond_${BPVER}_${ARCH}.deb" + +if [ "$THROWAWAY" = false ] ; then + # this exists in scripts/build_utils.sh + check_binary_existence $VENV $chacra_check_url +fi + +HOST=$(hostname --short) +echo "Building on $(hostname)" +echo " DIST=${DIST}" +echo " ARCH=${ARCH}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo "*****" +env +echo "*****" + +# Use pbuilder +echo "Building debs" + +pbuilddir="/srv/debian-base" + +sudo pbuilder --clean + +mkdir -p dist/deb + +echo "Building debs for $DIST" +sudo pbuilder build \ + --distribution $DIST \ + --basetgz $pbuilddir/$DIST.tgz \ + --buildresult dist/deb/ \ + --debbuildopts "-j`grep -c processor /proc/cpuinfo`" \ + dist/diamond_$VERSION.dsc + +# Make sure we execute at the top level directory +cd "$WORKSPACE" + +[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags="" + +if [ "$THROWAWAY" = false ] ; then + # push binaries to chacra + find dist/deb/ | egrep "*\.(changes|deb|dsc|gz)$" | egrep -v "(Packages|Sources|Contents)" | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/ + + # 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} +fi diff --git a/attic/diamond-build/build/build_rpm b/attic/diamond-build/build/build_rpm new file mode 100644 index 00000000..c47b7f04 --- /dev/null +++ b/attic/diamond-build/build/build_rpm @@ -0,0 +1,68 @@ +#!/bin/bash +set -ex + +# Only do actual work when we are an RPM distro +if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then + exit 0 +fi + +cd $WORKSPACE + +get_rpm_dist +dist=$DIST +[ -z "$dist" ] && echo no dist && exit 1 +echo dist $dist + +chacra_endpoint="diamond/${BRANCH}/${SHA1}/${DISTRO}/${RELEASE}" +chacra_check_url="${chacra_endpoint}/${ARCH}/diamond-${VERSION}-0.${DIST}.${ARCH}.rpm" + +if [ "$THROWAWAY" = false ] ; then + # this exists in scripts/build_utils.sh + check_binary_existence $VENV $chacra_check_url +fi + +HOST=$(hostname --short) +echo "Building on $(hostname)" +echo " DIST=${DIST}" +echo " ARCH=${ARCH}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo "*****" +env +echo "*****" + +# Install the dependencies +sudo yum-builddep -y dist/diamond.spec + +# Create the source rpm +echo "Building SRPM" +rpmbuild \ + --define "_sourcedir ./dist" \ + --define "_specdir ." \ + --define "_builddir ." \ + --define "_srcrpmdir ." \ + --define "_rpmdir ." \ + --define "dist .any" \ + --define "fedora 21" \ + --define "rhel 7" \ + --nodeps -bs dist/diamond.spec +SRPM=$(readlink -f *.src.rpm) + +# Build the binaries +echo "Building RPMs" +sudo mock -r epel-${RELEASE}-${ARCH} --resultdir=./dist/rpm/"%(dist)s"/"%(target_arch)s"/ ${SRPM} + +# Make sure we execute at the top level directory +cd "$WORKSPACE" + +[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags="" + +if [ "$THROWAWAY" = false ] ; then + # push binaries to chacra + find dist/rpm/$DIST/ | egrep '\.rpm$' | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/ + + # 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} +fi diff --git a/attic/diamond-build/build/setup b/attic/diamond-build/build/setup new file mode 100644 index 00000000..9b7a0f0f --- /dev/null +++ b/attic/diamond-build/build/setup @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Ceph distributed storage system +# +# Copyright (C) 2016 Red Hat +# +# Author: Boris Ranto +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +set -ex +HOST=$(hostname --short) +echo "Building on $(hostname)" +echo " DIST=${DIST}" +echo " BPTAG=${BPTAG}" +echo " KEYID=${KEYID}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo " BUILD SOURCE=$COPYARTIFACT_BUILD_NUMBER_CEPH_SETUP" +echo "*****" +env +echo "*****" + +if test $(id -u) != 0 ; then + SUDO=sudo +fi +export LC_ALL=C # the following is vulnerable to i18n + +if test -f /etc/redhat-release ; then + $SUDO yum install -y redhat-lsb-core +fi + +if which apt-get > /dev/null ; then + $SUDO apt-get install -y lsb-release +fi + +case $(lsb_release -si) in +CentOS|Fedora|SUSE*|RedHatEnterpriseServer) + case $(lsb_release -si) in + SUSE*) + $SUDO zypper -y yum-utils + ;; + *) + $SUDO yum install -y yum-utils mock + ;; + esac + ;; +*) + echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually." + ;; +esac + +pkgs=( "chacractl>=0.0.21" ) +TEMPVENV=$(create_venv_dir) +VENV=${TEMPVENV}/bin +install_python_packages $TEMPVENV "pkgs[@]" + +# ask shaman which chacra instance to use +chacra_url=`curl -f -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 diff --git a/attic/diamond-build/build/setup_pbuilder b/attic/diamond-build/build/setup_pbuilder new file mode 100755 index 00000000..c6c21c6c --- /dev/null +++ b/attic/diamond-build/build/setup_pbuilder @@ -0,0 +1,15 @@ +#!/bin/sh -x +# This file will set the tgz images needed for pbuilder on a given host. It has +# some hard-coded values like `/srv/debian-base` because it gets built every +# time this file is executed - completely ephemeral. If a Debian host will use +# pbuilder, then it will need this. Since it is not idempotent it makes +# everything a bit slower. ## FIXME ## + +set -e + +# Only run when we are a Debian or Debian-based distro +if test -f /etc/redhat-release ; then + exit 0 +fi + +setup_pbuilder diff --git a/attic/diamond-build/build/validate_deb b/attic/diamond-build/build/validate_deb new file mode 100644 index 00000000..0322b47a --- /dev/null +++ b/attic/diamond-build/build/validate_deb @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# Only do actual work when we are a DEB distro +if test -f /etc/redhat-release ; then + exit 0 +fi diff --git a/attic/diamond-build/build/validate_rpm b/attic/diamond-build/build/validate_rpm new file mode 100644 index 00000000..17b41482 --- /dev/null +++ b/attic/diamond-build/build/validate_rpm @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# only do work if we are a RPM distro +if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then + exit 0 +fi diff --git a/attic/diamond-build/config/definitions/diamond-build.yml b/attic/diamond-build/config/definitions/diamond-build.yml new file mode 100644 index 00000000..b4c3b4fe --- /dev/null +++ b/attic/diamond-build/config/definitions/diamond-build.yml @@ -0,0 +1,92 @@ +- job: + name: diamond-build + project-type: matrix + defaults: global + display-name: 'diamond-build' + block-downstream: false + block-upstream: false + concurrent: true + properties: + - github: + url: https://github.com/ceph/Diamond + 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: + - centos6 + - centos7 + - trusty + - xenial + - jessie + - precise + - wheezy + - axis: + type: dynamic + name: DIST + - axis: + type: dynamic + name: DIST + values: + - DISTROS + - axis: + type: dynamic + name: ARCH + values: + - ARCHS + + + + builders: + - shell: | + echo "Cleaning up top-level workarea (shared among workspaces)" + rm -rf dist + rm -rf venv + rm -rf release + - copyartifact: + project: diamond-setup + filter: 'dist/**' + which-build: last-successful + - inject: + properties-file: ${WORKSPACE}/dist/sha1 + - inject: + properties-file: ${WORKSPACE}/dist/branch + - inject: + properties-file: ${WORKSPACE}/dist/version + # debian build scripts + - shell: + !include-raw: + - ../../build/validate_deb + - ../../../scripts/build_utils.sh + - ../../build/setup + - ../../build/setup_pbuilder + - ../../build/build_deb + # rpm build scripts + - shell: + !include-raw: + - ../../build/validate_rpm + - ../../../scripts/build_utils.sh + - ../../build/setup + - ../../build/build_rpm + + wrappers: + - inject-passwords: + global: true + mask-password-params: true + - credentials-binding: + - text: + credential-id: shaman-api-key + variable: SHAMAN_API_KEY diff --git a/attic/diamond-setup/build/build b/attic/diamond-setup/build/build new file mode 100644 index 00000000..e264c0cc --- /dev/null +++ b/attic/diamond-setup/build/build @@ -0,0 +1,71 @@ +#!/bin/bash -ex + +## Get the basic setup/info +HOST=$(hostname --short) +echo "Building on ${HOST}" +echo " DIST=${DIST}" +echo " BPTAG=${BPTAG}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo " BRANCH=$BRANCH" +echo " SHA1=$GIT_COMMIT" + +if [ -x "$BRANCH" ] ; then + echo "No git branch was supplied" + exit 1 +fi + +echo "Building version $(git describe) Branch $BRANCH" + +## Make sure the repo is clean +# Remove all untracked files +echo "Cleaning up the repo" +git clean -fxd + +# Make sure the dist directory is clean +rm -rf dist +mkdir -p dist + +## Install any setup-time deps +# We need this for mk-build-deps +sudo apt-get install equivs +# Run the install-deps.sh upstream script if it exists +if [ -x install-deps.sh ]; then + echo "Ensuring dependencies are installed" + ./install-deps.sh +fi + +## Get the version +VERSION=$(./version.sh) + +## Build the source tarball +echo "Building source distribution" +python setup.py sdist + +## Prepare the spec file for build +sed -e "s/@VERSION@/${VERSION}/g" < diamond.spec.in > dist/diamond.spec + +## Prepare the debian files +# Bump the changelog +dch -v "$VERSION" "New release ($VERSION)" + +# Install build-time dependencies +yes | sudo mk-build-deps --install debian/control + +# Create .dsc and source tarball +sudo dpkg-buildpackage -S -us -uc + +cp ../diamond_$VERSION* dist/ + +## Save these so that we can later inject them into the build script +cat > dist/sha1 << EOF +SHA1=${GIT_COMMIT} +EOF + +cat > dist/branch << EOF +BRANCH=${BRANCH} +EOF + +cat > dist/version << EOF +VERSION=${VERSION} +EOF diff --git a/attic/diamond-setup/config/definitions/diamond-setup.yml b/attic/diamond-setup/config/definitions/diamond-setup.yml new file mode 100644 index 00000000..ee2aff23 --- /dev/null +++ b/attic/diamond-setup/config/definitions/diamond-setup.yml @@ -0,0 +1,48 @@ +- job: + name: diamond-setup + description: "This job step checks out the branch and builds the tarballs, diffs, and dsc that are passed to the diamond-build step.\r\n\r\nNotes:\r\nJob needs to run on a releatively recent debian system. The Restrict where run feature is used to specifiy an appropriate label.\r\nThe clear workspace before checkout box for the git plugin is used." + # we do not need to pin this to trusty anymore for the new jenkins instance + # FIXME: unpin when this gets ported over + node: small && trusty + display-name: 'diamond-setup' + block-downstream: false + block-upstream: false + concurrent: true + properties: + - build-discarder: + days-to-keep: -1 + num-to-keep: 25 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + - github: + url: https://github.com/ceph/Diamond + + parameters: + - string: + name: BRANCH + description: "The git branch (or tag) to build" + + scm: + - git: + url: git@github.com:ceph/Diamond.git + # Use the SSH key attached to the ceph-jenkins GitHub account. + credentials-id: 'jenkins-build' + branches: + - $BRANCH + skip-tag: true + wipe-workspace: true + + builders: + - shell: + !include-raw: ../../build/build + + publishers: + - archive: + artifacts: 'dist/**' + allow-empty: false + latest-only: false + + wrappers: + - inject-passwords: + global: true + mask-password-params: true diff --git a/attic/diamond/config/definitions/diamond.yml b/attic/diamond/config/definitions/diamond.yml new file mode 100644 index 00000000..7f3b3ce5 --- /dev/null +++ b/attic/diamond/config/definitions/diamond.yml @@ -0,0 +1,72 @@ +- job: + name: diamond + description: 'This is the main diamond build task which builds for testing purposes.' + project-type: multijob + defaults: global + concurrent: true + display-name: 'diamond' + block-downstream: false + block-upstream: false + properties: + - build-discarder: + days-to-keep: -1 + num-to-keep: 25 + artifact-days-to-keep: 25 + artifact-num-to-keep: 25 + - github: + url: https://github.com/ceph/Diamond + + parameters: + - string: + name: BRANCH + description: "The git branch (or tag) to build" + default: main + + - string: + name: DISTROS + description: "A list of distros to build for. Available options are: xenial, centos7, centos6, trusty, precise, wheezy, and jessie" + default: "centos7 trusty" + + - string: + name: ARCHS + description: "A list of architectures to build for. Available options are: x86_64, and arm64" + default: "x86_64" + + - bool: + name: THROWAWAY + description: " +Default: False. When True it will not POST binaries to chacra. Artifacts will not be around for long. Useful to test builds." + default: false + + - 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: DIAMOND_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/" + + builders: + - multijob: + name: 'diamond setup phase' + condition: SUCCESSFUL + projects: + - name: diamond-setup + current-parameters: true + exposed-scm: false + - multijob: + name: 'diamond build phase' + condition: SUCCESSFUL + projects: + - name: diamond-build + current-parameters: true + exposed-scm: false + + wrappers: + - inject-passwords: + global: true + mask-password-params: true diff --git a/ceph-medic-docs/build/build b/ceph-medic-docs/build/build deleted file mode 100644 index 3de81e41..00000000 --- a/ceph-medic-docs/build/build +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -ex - -# the following two methods exist in scripts/build_utils.sh -pkgs=( "tox" ) -TEMPVENV=$(create_venv_dir) -VENV=${TEMPVENV}/bin -install_python_packages $TEMPVENV "pkgs[@]" - -# trims leading slashes -BRANCH=`branch_slash_filter ${GIT_BRANCH}` - -# create the docs build with tox -$VENV/tox -rv -e docs - -# publish docs to http://docs.ceph.com/ceph-medic/$BRANCH/ create -# a `$BRANCH` dir because the project has stable branches that will -# publish docs that might be different from other versions (similar, -# but not exactly the same to what the Ceph project does) -mkdir -p "/var/ceph-medic/docs/$BRANCH" -rsync -auv --delete .tox/docs/tmp/html/* "/var/ceph-medic/docs/$BRANCH/" - diff --git a/ceph-medic-docs/config/definitions/ceph-medic-docs.yml b/ceph-medic-docs/config/definitions/ceph-medic-docs.yml deleted file mode 100644 index 6401e934..00000000 --- a/ceph-medic-docs/config/definitions/ceph-medic-docs.yml +++ /dev/null @@ -1,39 +0,0 @@ -- job: - name: ceph-medic-docs - node: docs - project-type: freestyle - defaults: global - display-name: 'ceph-medic: docs build' - quiet-period: 5 - block-downstream: false - block-upstream: false - retry-count: 3 - properties: - - build-discarder: - days-to-keep: -1 - num-to-keep: 10 - artifact-days-to-keep: -1 - artifact-num-to-keep: -1 - - github: - url: https://github.com/ceph/ceph-medic - - triggers: - - github - - scm: - - git: - url: https://github.com/ceph/ceph-medic - branches: - - main - # as more stable branches are published, they need to be - # added here - #- stable-1.0 - browser: auto - skip-tag: true - timeout: 20 - - builders: - - shell: - !include-raw: - - ../../../scripts/build_utils.sh - - ../../build/build diff --git a/ceph-medic-pull-requests/build/build b/ceph-medic-pull-requests/build/build deleted file mode 100644 index c08420b7..00000000 --- a/ceph-medic-pull-requests/build/build +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# the following two methods exist in scripts/build_utils.sh -pkgs=( "tox" ) -TEMPVENV=$(create_venv_dir) -VENV=${TEMPVENV}/bin -install_python_packages $TEMPVENV "pkgs[@]" - -sudo yum install -y epel-release -sudo yum --enablerepo epel install -y python36 - -cd "$WORKSPACE/ceph-medic" - -export TOX_SKIP_ENV=py37 -$VENV/tox -rv diff --git a/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml b/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml deleted file mode 100644 index 1f04dafc..00000000 --- a/ceph-medic-pull-requests/config/definitions/ceph-medic-pull-requests.yml +++ /dev/null @@ -1,64 +0,0 @@ -- scm: - name: ceph-medic - scm: - - git: - url: https://github.com/ceph/ceph-medic - branches: - - ${sha1} - refspec: +refs/pull/*:refs/remotes/origin/pr/* - browser: auto - timeout: 20 - basedir: "ceph-medic" - skip-tag: true - wipe-workspace: true - - -- job: - name: ceph-medic-pull-requests - description: Runs tox tests for ceph-medic on each GitHub PR - project-type: freestyle - node: python3 && centos7 - block-downstream: false - block-upstream: false - defaults: global - display-name: 'ceph-medic: Pull Requests' - quiet-period: 5 - retry-count: 3 - - - properties: - - build-discarder: - days-to-keep: 15 - num-to-keep: 30 - artifact-days-to-keep: 15 - artifact-num-to-keep: 15 - - github: - url: https://github.com/ceph/ceph-medic/ - - parameters: - - string: - name: sha1 - description: "A pull request ID, like 'origin/pr/72/head'" - - triggers: - - github-pull-request: - admin-list: - - dmick - - ktdreyer - - andrewschoen - - zmc - org-list: - - ceph - only-trigger-phrase: false - github-hooks: true - permit-all: true - auto-close-on-fail: false - - scm: - - ceph-medic - - builders: - - shell: - !include-raw: - - ../../../scripts/build_utils.sh - - ../../build/build diff --git a/ceph-medic-release/build/build_rpm b/ceph-medic-release/build/build_rpm deleted file mode 100644 index fa3f8e24..00000000 --- a/ceph-medic-release/build/build_rpm +++ /dev/null @@ -1,38 +0,0 @@ -#!/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 - - -sudo yum -y install epel-release -sudo yum -y install fedpkg 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.21" ) -TEMPVENV=$(create_venv_dir) -VENV=${TEMPVENV}/bin -install_python_packages $TEMPVENV "pkgs[@]" - -make_chacractl_config - -BRANCH=`branch_slash_filter $GIT_BRANCH` - -## Upload the created RPMs to chacra -chacra_endpoint="ceph-medic/${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 deleted file mode 100644 index 3dea2239..00000000 --- a/ceph-medic-release/config/definitions/ceph-medic-release.yml +++ /dev/null @@ -1,99 +0,0 @@ -- 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: "main" - - - 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 - - bionic - - axis: - type: dynamic - name: DIST - values: - - DISTROS - - axis: - type: dynamic - name: ARCH - values: - - ARCHS - - scm: - - git: - url: https://github.com/ceph/ceph-medic - 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 - - credentials-binding: - - text: - credential-id: chacractl-key - variable: CHACRACTL_KEY diff --git a/ceph-medic-rpm/build/build b/ceph-medic-rpm/build/build deleted file mode 100644 index 46be3f83..00000000 --- a/ceph-medic-rpm/build/build +++ /dev/null @@ -1,43 +0,0 @@ -#!/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 - -# 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.21" ) -TEMPVENV=$(create_venv_dir) -VENV=${TEMPVENV}/bin -install_python_packages $TEMPVENV "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 deleted file mode 100644 index 3b5111c2..00000000 --- a/ceph-medic-rpm/config/definitions/ceph-medic-rpm.yml +++ /dev/null @@ -1,48 +0,0 @@ -- 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: - - build-discarder: - days-to-keep: 1 - num-to-keep: 10 - artifact-days-to-keep: -1 - artifact-num-to-keep: -1 - - github: - url: https://github.com/ceph/ceph-medic - discard-old-builds: true - - 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 - - credentials-binding: - - text: - credential-id: shaman-api-key - variable: SHAMAN_API_KEY diff --git a/diamond-build/build/build_deb b/diamond-build/build/build_deb deleted file mode 100644 index 103644ac..00000000 --- a/diamond-build/build/build_deb +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -set -ex - -# Only do actual work when we are a DEB distro -if test -f /etc/redhat-release ; then - exit 0 -fi - -cd $WORKSPACE - -# slap -rc to the ref if we are doing a release-candidate build -chacra_ref="$BRANCH" -[ "$RC" = true ] && chacra_ref="$BRANCH-rc" -[ "$TEST" = true ] && chacra_ref="test" - -ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH) -DISTRO="" -case $DIST in - jessie|wheezy) - DISTRO="debian" - ;; - *) - DISTRO="ubuntu" - ;; -esac - -debian_version=${VERSION}-1 - -BPVER=`gen_debian_version $debian_version $DIST` - -chacra_endpoint="diamond/${BRANCH}/${SHA1}/${DISTRO}/${DIST}" -chacra_check_url="${chacra_endpoint}/diamond_${BPVER}_${ARCH}.deb" - -if [ "$THROWAWAY" = false ] ; then - # this exists in scripts/build_utils.sh - check_binary_existence $VENV $chacra_check_url -fi - -HOST=$(hostname --short) -echo "Building on $(hostname)" -echo " DIST=${DIST}" -echo " ARCH=${ARCH}" -echo " WS=$WORKSPACE" -echo " PWD=$(pwd)" -echo "*****" -env -echo "*****" - -# Use pbuilder -echo "Building debs" - -pbuilddir="/srv/debian-base" - -sudo pbuilder --clean - -mkdir -p dist/deb - -echo "Building debs for $DIST" -sudo pbuilder build \ - --distribution $DIST \ - --basetgz $pbuilddir/$DIST.tgz \ - --buildresult dist/deb/ \ - --debbuildopts "-j`grep -c processor /proc/cpuinfo`" \ - dist/diamond_$VERSION.dsc - -# Make sure we execute at the top level directory -cd "$WORKSPACE" - -[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags="" - -if [ "$THROWAWAY" = false ] ; then - # push binaries to chacra - find dist/deb/ | egrep "*\.(changes|deb|dsc|gz)$" | egrep -v "(Packages|Sources|Contents)" | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/ - - # 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} -fi diff --git a/diamond-build/build/build_rpm b/diamond-build/build/build_rpm deleted file mode 100644 index c47b7f04..00000000 --- a/diamond-build/build/build_rpm +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -set -ex - -# Only do actual work when we are an RPM distro -if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then - exit 0 -fi - -cd $WORKSPACE - -get_rpm_dist -dist=$DIST -[ -z "$dist" ] && echo no dist && exit 1 -echo dist $dist - -chacra_endpoint="diamond/${BRANCH}/${SHA1}/${DISTRO}/${RELEASE}" -chacra_check_url="${chacra_endpoint}/${ARCH}/diamond-${VERSION}-0.${DIST}.${ARCH}.rpm" - -if [ "$THROWAWAY" = false ] ; then - # this exists in scripts/build_utils.sh - check_binary_existence $VENV $chacra_check_url -fi - -HOST=$(hostname --short) -echo "Building on $(hostname)" -echo " DIST=${DIST}" -echo " ARCH=${ARCH}" -echo " WS=$WORKSPACE" -echo " PWD=$(pwd)" -echo "*****" -env -echo "*****" - -# Install the dependencies -sudo yum-builddep -y dist/diamond.spec - -# Create the source rpm -echo "Building SRPM" -rpmbuild \ - --define "_sourcedir ./dist" \ - --define "_specdir ." \ - --define "_builddir ." \ - --define "_srcrpmdir ." \ - --define "_rpmdir ." \ - --define "dist .any" \ - --define "fedora 21" \ - --define "rhel 7" \ - --nodeps -bs dist/diamond.spec -SRPM=$(readlink -f *.src.rpm) - -# Build the binaries -echo "Building RPMs" -sudo mock -r epel-${RELEASE}-${ARCH} --resultdir=./dist/rpm/"%(dist)s"/"%(target_arch)s"/ ${SRPM} - -# Make sure we execute at the top level directory -cd "$WORKSPACE" - -[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags="" - -if [ "$THROWAWAY" = false ] ; then - # push binaries to chacra - find dist/rpm/$DIST/ | egrep '\.rpm$' | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/$ARCH/ - - # 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} -fi diff --git a/diamond-build/build/setup b/diamond-build/build/setup deleted file mode 100644 index 9b7a0f0f..00000000 --- a/diamond-build/build/setup +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# -# Ceph distributed storage system -# -# Copyright (C) 2016 Red Hat -# -# Author: Boris Ranto -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -set -ex -HOST=$(hostname --short) -echo "Building on $(hostname)" -echo " DIST=${DIST}" -echo " BPTAG=${BPTAG}" -echo " KEYID=${KEYID}" -echo " WS=$WORKSPACE" -echo " PWD=$(pwd)" -echo " BUILD SOURCE=$COPYARTIFACT_BUILD_NUMBER_CEPH_SETUP" -echo "*****" -env -echo "*****" - -if test $(id -u) != 0 ; then - SUDO=sudo -fi -export LC_ALL=C # the following is vulnerable to i18n - -if test -f /etc/redhat-release ; then - $SUDO yum install -y redhat-lsb-core -fi - -if which apt-get > /dev/null ; then - $SUDO apt-get install -y lsb-release -fi - -case $(lsb_release -si) in -CentOS|Fedora|SUSE*|RedHatEnterpriseServer) - case $(lsb_release -si) in - SUSE*) - $SUDO zypper -y yum-utils - ;; - *) - $SUDO yum install -y yum-utils mock - ;; - esac - ;; -*) - echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually." - ;; -esac - -pkgs=( "chacractl>=0.0.21" ) -TEMPVENV=$(create_venv_dir) -VENV=${TEMPVENV}/bin -install_python_packages $TEMPVENV "pkgs[@]" - -# ask shaman which chacra instance to use -chacra_url=`curl -f -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 diff --git a/diamond-build/build/setup_pbuilder b/diamond-build/build/setup_pbuilder deleted file mode 100755 index c6c21c6c..00000000 --- a/diamond-build/build/setup_pbuilder +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -x -# This file will set the tgz images needed for pbuilder on a given host. It has -# some hard-coded values like `/srv/debian-base` because it gets built every -# time this file is executed - completely ephemeral. If a Debian host will use -# pbuilder, then it will need this. Since it is not idempotent it makes -# everything a bit slower. ## FIXME ## - -set -e - -# Only run when we are a Debian or Debian-based distro -if test -f /etc/redhat-release ; then - exit 0 -fi - -setup_pbuilder diff --git a/diamond-build/build/validate_deb b/diamond-build/build/validate_deb deleted file mode 100644 index 0322b47a..00000000 --- a/diamond-build/build/validate_deb +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -ex - -# Only do actual work when we are a DEB distro -if test -f /etc/redhat-release ; then - exit 0 -fi diff --git a/diamond-build/build/validate_rpm b/diamond-build/build/validate_rpm deleted file mode 100644 index 17b41482..00000000 --- a/diamond-build/build/validate_rpm +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -ex - -# only do work if we are a RPM distro -if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then - exit 0 -fi diff --git a/diamond-build/config/definitions/diamond-build.yml b/diamond-build/config/definitions/diamond-build.yml deleted file mode 100644 index b4c3b4fe..00000000 --- a/diamond-build/config/definitions/diamond-build.yml +++ /dev/null @@ -1,92 +0,0 @@ -- job: - name: diamond-build - project-type: matrix - defaults: global - display-name: 'diamond-build' - block-downstream: false - block-upstream: false - concurrent: true - properties: - - github: - url: https://github.com/ceph/Diamond - 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: - - centos6 - - centos7 - - trusty - - xenial - - jessie - - precise - - wheezy - - axis: - type: dynamic - name: DIST - - axis: - type: dynamic - name: DIST - values: - - DISTROS - - axis: - type: dynamic - name: ARCH - values: - - ARCHS - - - - builders: - - shell: | - echo "Cleaning up top-level workarea (shared among workspaces)" - rm -rf dist - rm -rf venv - rm -rf release - - copyartifact: - project: diamond-setup - filter: 'dist/**' - which-build: last-successful - - inject: - properties-file: ${WORKSPACE}/dist/sha1 - - inject: - properties-file: ${WORKSPACE}/dist/branch - - inject: - properties-file: ${WORKSPACE}/dist/version - # debian build scripts - - shell: - !include-raw: - - ../../build/validate_deb - - ../../../scripts/build_utils.sh - - ../../build/setup - - ../../build/setup_pbuilder - - ../../build/build_deb - # rpm build scripts - - shell: - !include-raw: - - ../../build/validate_rpm - - ../../../scripts/build_utils.sh - - ../../build/setup - - ../../build/build_rpm - - wrappers: - - inject-passwords: - global: true - mask-password-params: true - - credentials-binding: - - text: - credential-id: shaman-api-key - variable: SHAMAN_API_KEY diff --git a/diamond-setup/build/build b/diamond-setup/build/build deleted file mode 100644 index e264c0cc..00000000 --- a/diamond-setup/build/build +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -ex - -## Get the basic setup/info -HOST=$(hostname --short) -echo "Building on ${HOST}" -echo " DIST=${DIST}" -echo " BPTAG=${BPTAG}" -echo " WS=$WORKSPACE" -echo " PWD=$(pwd)" -echo " BRANCH=$BRANCH" -echo " SHA1=$GIT_COMMIT" - -if [ -x "$BRANCH" ] ; then - echo "No git branch was supplied" - exit 1 -fi - -echo "Building version $(git describe) Branch $BRANCH" - -## Make sure the repo is clean -# Remove all untracked files -echo "Cleaning up the repo" -git clean -fxd - -# Make sure the dist directory is clean -rm -rf dist -mkdir -p dist - -## Install any setup-time deps -# We need this for mk-build-deps -sudo apt-get install equivs -# Run the install-deps.sh upstream script if it exists -if [ -x install-deps.sh ]; then - echo "Ensuring dependencies are installed" - ./install-deps.sh -fi - -## Get the version -VERSION=$(./version.sh) - -## Build the source tarball -echo "Building source distribution" -python setup.py sdist - -## Prepare the spec file for build -sed -e "s/@VERSION@/${VERSION}/g" < diamond.spec.in > dist/diamond.spec - -## Prepare the debian files -# Bump the changelog -dch -v "$VERSION" "New release ($VERSION)" - -# Install build-time dependencies -yes | sudo mk-build-deps --install debian/control - -# Create .dsc and source tarball -sudo dpkg-buildpackage -S -us -uc - -cp ../diamond_$VERSION* dist/ - -## Save these so that we can later inject them into the build script -cat > dist/sha1 << EOF -SHA1=${GIT_COMMIT} -EOF - -cat > dist/branch << EOF -BRANCH=${BRANCH} -EOF - -cat > dist/version << EOF -VERSION=${VERSION} -EOF diff --git a/diamond-setup/config/definitions/diamond-setup.yml b/diamond-setup/config/definitions/diamond-setup.yml deleted file mode 100644 index ee2aff23..00000000 --- a/diamond-setup/config/definitions/diamond-setup.yml +++ /dev/null @@ -1,48 +0,0 @@ -- job: - name: diamond-setup - description: "This job step checks out the branch and builds the tarballs, diffs, and dsc that are passed to the diamond-build step.\r\n\r\nNotes:\r\nJob needs to run on a releatively recent debian system. The Restrict where run feature is used to specifiy an appropriate label.\r\nThe clear workspace before checkout box for the git plugin is used." - # we do not need to pin this to trusty anymore for the new jenkins instance - # FIXME: unpin when this gets ported over - node: small && trusty - display-name: 'diamond-setup' - block-downstream: false - block-upstream: false - concurrent: true - properties: - - build-discarder: - days-to-keep: -1 - num-to-keep: 25 - artifact-days-to-keep: -1 - artifact-num-to-keep: -1 - - github: - url: https://github.com/ceph/Diamond - - parameters: - - string: - name: BRANCH - description: "The git branch (or tag) to build" - - scm: - - git: - url: git@github.com:ceph/Diamond.git - # Use the SSH key attached to the ceph-jenkins GitHub account. - credentials-id: 'jenkins-build' - branches: - - $BRANCH - skip-tag: true - wipe-workspace: true - - builders: - - shell: - !include-raw: ../../build/build - - publishers: - - archive: - artifacts: 'dist/**' - allow-empty: false - latest-only: false - - wrappers: - - inject-passwords: - global: true - mask-password-params: true diff --git a/diamond/config/definitions/diamond.yml b/diamond/config/definitions/diamond.yml deleted file mode 100644 index 7f3b3ce5..00000000 --- a/diamond/config/definitions/diamond.yml +++ /dev/null @@ -1,72 +0,0 @@ -- job: - name: diamond - description: 'This is the main diamond build task which builds for testing purposes.' - project-type: multijob - defaults: global - concurrent: true - display-name: 'diamond' - block-downstream: false - block-upstream: false - properties: - - build-discarder: - days-to-keep: -1 - num-to-keep: 25 - artifact-days-to-keep: 25 - artifact-num-to-keep: 25 - - github: - url: https://github.com/ceph/Diamond - - parameters: - - string: - name: BRANCH - description: "The git branch (or tag) to build" - default: main - - - string: - name: DISTROS - description: "A list of distros to build for. Available options are: xenial, centos7, centos6, trusty, precise, wheezy, and jessie" - default: "centos7 trusty" - - - string: - name: ARCHS - description: "A list of architectures to build for. Available options are: x86_64, and arm64" - default: "x86_64" - - - bool: - name: THROWAWAY - description: " -Default: False. When True it will not POST binaries to chacra. Artifacts will not be around for long. Useful to test builds." - default: false - - - 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: DIAMOND_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/" - - builders: - - multijob: - name: 'diamond setup phase' - condition: SUCCESSFUL - projects: - - name: diamond-setup - current-parameters: true - exposed-scm: false - - multijob: - name: 'diamond build phase' - condition: SUCCESSFUL - projects: - - name: diamond-build - current-parameters: true - exposed-scm: false - - wrappers: - - inject-passwords: - global: true - mask-password-params: true