From 6c40cbdde18bd642ebf5aacdb7b7c9e4b209b5f0 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Mon, 28 Oct 2024 16:32:22 +0530 Subject: [PATCH] build-rpms: Add support for multi-arch builds --- jobs/nightly-samba-builds.yml | 16 +++++++++++----- jobs/scripts/common/get-node.sh | 4 ++-- .../nightly-samba-builds/nightly-samba-builds.sh | 8 ++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/jobs/nightly-samba-builds.yml b/jobs/nightly-samba-builds.yml index 1cb1f22..5ff62ed 100644 --- a/jobs/nightly-samba-builds.yml +++ b/jobs/nightly-samba-builds.yml @@ -4,15 +4,17 @@ - 'centos9' - 'fedora40' - 'fedora39' + os_arch: + - 'x86_64' samba_branch: - 'master' - 'v4-20-test' - 'v4-21-test' jobs: - - 'samba_build-rpms-{os_version}-{samba_branch}' + - 'samba_build-rpms-{os_version}-{samba_branch}-{os_arch}' - job-template: - name: 'samba_build-rpms-{os_version}-{samba_branch}' + name: 'samba_build-rpms-{os_version}-{samba_branch}-{os_arch}' node: cico-workspace description: Build Samba RPMs. project-type: freestyle @@ -27,6 +29,10 @@ name: OS_VERSION default: '{os_version}' description: Platform to build the RPMS + - string: + name: CENTOS_ARCH + default: '{os_arch}' + description: Architecture to build the RPMS - string: name: SAMBA_BRANCH default: '{samba_branch}' @@ -46,7 +52,7 @@ triggers: - timed: "H 0 * * *" - github-pull-request: - trigger-phrase: '/(re)?test ((all)|(centos-ci/build-rpms/({os_version}/{samba_branch})?))' + trigger-phrase: '/(re)?test ((all)|(centos-ci/build-rpms/({os_version}/{samba_branch}/{os_arch})?))' admin-list: - obnoxxx - gd @@ -55,7 +61,7 @@ - nixpanic - phlogistonjohn cron: H/5 * * * * - status-context: 'centos-ci/build-rpms/{os_version}/{samba_branch}' + status-context: 'centos-ci/build-rpms/{os_version}/{samba_branch}/{os_arch}' white-list-target-branches: - main - pollurl: @@ -70,7 +76,7 @@ - shell: !include-raw-escape: scripts/common/scp.sh - shell: | #!/bin/bash - jobs/scripts/common/bootstrap.sh $WORKSPACE/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh "ghprbPullId=$ghprbPullId ghprbTargetBranch=$ghprbTargetBranch OS_VERSION=$OS_VERSION SAMBA_BRANCH=$SAMBA_BRANCH" + jobs/scripts/common/bootstrap.sh $WORKSPACE/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh "ghprbPullId=$ghprbPullId ghprbTargetBranch=$ghprbTargetBranch OS_VERSION=$OS_VERSION OS_ARCH=$CENTOS_ARCH SAMBA_BRANCH=$SAMBA_BRANCH" publishers: - email-ext: diff --git a/jobs/scripts/common/get-node.sh b/jobs/scripts/common/get-node.sh index b8534ad..672fa3c 100644 --- a/jobs/scripts/common/get-node.sh +++ b/jobs/scripts/common/get-node.sh @@ -12,9 +12,9 @@ client: EOF if [[ "${JOB_NAME}" =~ rpms ]]; then - POOL_MATCH="^(virt-ec2)(.*)(centos-${CENTOS_VERSION}-x86_64)$" + POOL_MATCH="^(virt-ec2)(.*)(centos-${CENTOS_VERSION}-${CENTOS_ARCH})$" else - POOL_MATCH="^(metal-ec2)(.*)(centos-${CENTOS_VERSION}-x86_64)$" + POOL_MATCH="^(metal-ec2)(.*)(centos-${CENTOS_VERSION}-${CENTOS_ARCH})$" fi readarray -t POOLS < <(duffy client list-pools | jq -r '.pools[].name') diff --git a/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh b/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh index 7b2ced9..4338b4c 100755 --- a/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh +++ b/jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh @@ -6,9 +6,9 @@ SAMBA_BRANCH="${SAMBA_BRANCH:-master}" SAMBA_MAJOR_VERS=$([ "${SAMBA_BRANCH}" != "master" ] && ( (tmp="${SAMBA_BRANCH//[a-zA-Z]}" && echo "${tmp//-/.}") | sed 's/.$//' ) || echo "${SAMBA_BRANCH}" ) PLATFORM="${OS_VERSION//[0-9]}" VERSION="${OS_VERSION//[a-zA-Z]}" -CENTOS_ARCH='x86_64' +ARCH=${OS_ARCH:-x86_64} RESULT_BASE="/tmp/samba-build/rpms" -RESULT_DIR="${RESULT_BASE}/${SAMBA_MAJOR_VERS}/${PLATFORM}/${VERSION}/${CENTOS_ARCH}" +RESULT_DIR="${RESULT_BASE}/${SAMBA_MAJOR_VERS}/${PLATFORM}/${VERSION}/${ARCH}" REPO_NAME="samba-nightly-${SAMBA_MAJOR_VERS}" REPO_FILE="${RESULT_BASE}/${SAMBA_MAJOR_VERS}/${PLATFORM}/${REPO_NAME}.repo" @@ -71,8 +71,8 @@ then fi -make "rpms.${PLATFORM}" "vers=${VERSION}" "refspec=${SAMBA_BRANCH}" -make "test.rpms.${PLATFORM}" "vers=${VERSION}" "refspec=${SAMBA_BRANCH}" +make "rpms.${PLATFORM}" "vers=${VERSION}" "arch=${ARCH}" "refspec=${SAMBA_BRANCH}" +make "test.rpms.${PLATFORM}" "vers=${VERSION}" "arch=${ARCH}" "refspec=${SAMBA_BRANCH}" # Don't upload the artifacts if running on a PR. if [ -n "${ghprbPullId}" ]