From 5bb3f56967b2881fb1e9cdbf6e5f7061cdbfc3d1 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 15 Jul 2021 15:32:17 -0700 Subject: [PATCH] add ceph-grafana-trigger job Build both x86_64 and arm64 containers using ceph-grafana job, and then pull, create a combined manifest, and push, currently to both docker.io and quay.io Signed-off-by: Dan Mick --- ceph-grafana-trigger/build/build | 21 +++++++ .../definitions/ceph-grafana-trigger.yml | 62 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 ceph-grafana-trigger/build/build create mode 100644 ceph-grafana-trigger/config/definitions/ceph-grafana-trigger.yml diff --git a/ceph-grafana-trigger/build/build b/ceph-grafana-trigger/build/build new file mode 100644 index 00000000..03fbb2cf --- /dev/null +++ b/ceph-grafana-trigger/build/build @@ -0,0 +1,21 @@ +#!/bin/bash -ex + +CONTAINER_VERSION=${CONTAINER_VERSION:-6.7.4} +CONTAINER=ceph/ceph-grafana:${CONTAINER_VERSION} +sudo dnf install -y podman +sudo podman login docker.io -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD} +sudo podman login quay.io -u ${CONTAINER_REPO_USERNAME} -p ${CONTAINER_REPO_PASSWORD} + +for repohost in quay.io docker.io; do + sudo podman rmi -f grafana:${CONTAINER_VERSION}-combined ${repohost}/${CONTAINER}-x86_64 ${repohost}/${CONTAINER}-aarch64 || true + + sudo podman pull ${repohost}/${CONTAINER}-x86_64 + sudo podman pull ${repohost}/${CONTAINER}-aarch64 + sudo podman manifest create grafana:${CONTAINER_VERSION}-combined + sudo podman manifest add grafana:${CONTAINER_VERSION}-combined ${repohost}/${CONTAINER}-x86_64 + sudo podman manifest add grafana:${CONTAINER_VERSION}-combined ${repohost}/${CONTAINER}-aarch64 + + sudo podman manifest push grafana:${CONTAINER_VERSION}-combined ${repohost}/${CONTAINER}-combined + + sudo podman rmi -f grafana:${CONTAINER_VERSION}-combined ${repohost}/${CONTAINER}-x86_64 ${repohost}/${CONTAINER}-aarch64 || true +done diff --git a/ceph-grafana-trigger/config/definitions/ceph-grafana-trigger.yml b/ceph-grafana-trigger/config/definitions/ceph-grafana-trigger.yml new file mode 100644 index 00000000..82263e0c --- /dev/null +++ b/ceph-grafana-trigger/config/definitions/ceph-grafana-trigger.yml @@ -0,0 +1,62 @@ +- job: + name: ceph-grafana-trigger + description: 'Build a combined container image "manifest list" for ceph-grafana that includes both architectures' + node: centos8 + project-type: freestyle + defaults: global + concurrent: true + display-name: 'ceph-grafana-trigger' + block-downstream: true + properties: + - build-discarder: + days-to-keep: -1 + num-to-keep: 10 + artifact-num-to-keep: 10 + - github: + url: https://github.com/ceph/ceph + + parameters: + - string: + name: BRANCH + description: "The git branch (or tag) to build" + default: master + - string: + name: CONTAINER_VERSION + description: "The version tag for the containers; will have -ARCH added to it. By convention, the version of Grafana" + default: "6.7.4" + axes: + - axis: + type: label-expression + name: ARCH + values: + - x86_64 + - arm64 + builders: + - trigger-builds: + - project: ceph-grafana + predefined-parameters: ARCH=x86_64 + current-parameters: true + block: true + - trigger-builds: + - project: ceph-grafana + predefined-parameters: ARCH=arm64 + current-parameters: true + block: true + - shell: + !include-raw: ../../build/build + + wrappers: + - inject-passwords: + global: true + mask-password-params: true + - credentials-binding: + - username-password-separated: + credential-id: docker-hub-leseb + username: DOCKER_HUB_USERNAME + password: DOCKER_HUB_PASSWORD + - username-password-separated: + credential-id: dmick-quay + username: CONTAINER_REPO_USERNAME + password: CONTAINER_REPO_PASSWORD + - build-name: + name: "#${BUILD_NUMBER} ${BRANCH}" -- 2.39.5