Skip to content

Commit

Permalink
build-rpms: Add support for multi-arch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
anoopcs9 authored and obnoxxx committed Oct 29, 2024
1 parent 088fab9 commit 6c40cbd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
16 changes: 11 additions & 5 deletions jobs/nightly-samba-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}'
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions jobs/scripts/common/get-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions jobs/scripts/nightly-samba-builds/nightly-samba-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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}" ]
Expand Down

0 comments on commit 6c40cbd

Please sign in to comment.