-
Notifications
You must be signed in to change notification settings - Fork 4
Add jobs to build+push samba containers #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
anoopcs9
merged 4 commits into
samba-in-kubernetes:main
from
anoopcs9:add-container-jobs
Jan 8, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
840df1d
jobs/scripts: Add basic steps to build+push samba containers
anoopcs9 ed4e86a
jobs: Add basic job configuration for building containers
anoopcs9 08ae89d
scripts: Reserve virtualized environments for container build jobs
anoopcs9 468e647
build-containers: Extend the job matrix
anoopcs9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
- project: | ||
name: samba_nightly-containers | ||
os_name: | ||
- 'centos' | ||
- 'fedora' | ||
os_arch: | ||
- 'aarch64' | ||
- 'x86_64' | ||
kind: | ||
- 'server' | ||
package_source: | ||
- 'default' | ||
- 'devbuilds' | ||
- 'nightly' | ||
exclude: | ||
# ceph development rpm builds are not available for fedora | ||
- os_name: 'fedora' | ||
package_source: 'devbuilds' | ||
# resilient storage providing ctdb on centos is not available for aarch64 | ||
- os_name: 'centos' | ||
os_arch: 'aarch64' | ||
package_source: 'default' | ||
jobs: | ||
- 'samba_build-containers-{kind}-{package_source}-{os_name}-{os_arch}' | ||
|
||
- job-template: | ||
name: 'samba_build-containers-{kind}-{package_source}-{os_name}-{os_arch}' | ||
node: cico-workspace | ||
description: Build Samba containers. | ||
project-type: freestyle | ||
concurrent: true | ||
|
||
parameters: | ||
- string: | ||
name: CENTOS_VERSION | ||
default: '9s' | ||
description: CentOS version to be installed on host node | ||
- string: | ||
name: OS_NAME | ||
default: '{os_name}' | ||
description: Platform to build the containers | ||
- string: | ||
name: OS_ARCH | ||
default: '{os_arch}' | ||
description: Architecture to build the containers | ||
- string: | ||
name: KIND | ||
default: '{kind}' | ||
description: Type of samba server | ||
- string: | ||
name: PACKAGE_SOURCE | ||
default: '{package_source}' | ||
description: Repository with required packages | ||
|
||
wrappers: | ||
- credentials-binding: | ||
- username-password-separated: | ||
credential-id: container-registry-auth | ||
username: IMG_REGISTRY_USER | ||
password: IMG_REGISTRY_PASSWORD | ||
|
||
scm: | ||
- git: | ||
url: https://github.com/samba-in-kubernetes/samba-centosci.git | ||
|
||
properties: | ||
- github: | ||
url: https://github.com/samba-in-kubernetes/samba-container | ||
- build-discarder: | ||
days-to-keep: 7 | ||
artifacts-days-to-keep: 7 | ||
|
||
triggers: | ||
- timed: "H 3 * * *" | ||
- pollurl: | ||
cron: 'H/5 * * * *' | ||
urls: | ||
- url: 'https://github.com/samba-in-kubernetes/samba-container/commit/main.patch' | ||
check-content: | ||
- simple: true | ||
|
||
builders: | ||
- shell: !include-raw-escape: scripts/common/get-node.sh | ||
- shell: !include-raw-escape: scripts/common/scp.sh | ||
- shell: | | ||
#!/bin/bash | ||
jobs/scripts/common/bootstrap.sh $WORKSPACE/jobs/scripts/nightly-samba-containers/nightly-samba-containers.sh "OS_NAME=$OS_NAME OS_ARCH=$OS_ARCH KIND=$KIND PACKAGE_SOURCE=$PACKAGE_SOURCE IMG_REGISTRY_USER=$IMG_REGISTRY_USER IMG_REGISTRY_PASSWORD=$IMG_REGISTRY_PASSWORD" | ||
|
||
publishers: | ||
- email-ext: | ||
recipients: [email protected] | ||
reply-to: $DEFAULT_REPLYTO | ||
subject: $DEFAULT_SUBJECT | ||
content-type: text | ||
body: $DEFAULT_CONTENT | ||
- post-tasks: | ||
- matches: | ||
- log-text: Building remotely | ||
script: | ||
!include-raw-escape: scripts/common/return-node.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
jobs/scripts/nightly-samba-containers/nightly-samba-containers.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
CONTAINER_GIT_REPO="https://github.com/samba-in-kubernetes/samba-container" | ||
CONTAINER_GIT_BRANCH="master" | ||
CONTAINER_CMD=${CONTAINER_CMD:-podman} | ||
IMG_REGISTRY="quay.io" | ||
# Temporarily using John Mulligan's quay.io repository with a bot account until | ||
# jobs are complete and stable enough for container images to be published on | ||
# quay.io/samba.org | ||
IMG_REGISTRY_BASE="${IMG_REGISTRY}/phlogistonjohn" | ||
# At the moment we are interested in pushing unqualified tags only for x86_64 | ||
PUSH_TAGS_SELECTION=$([[ $OS_ARCH != "x86_64" ]] && echo "fqin" || echo "mixed") | ||
|
||
# if anything fails, we'll abort | ||
set -e | ||
|
||
dnf -y install git make podman | ||
|
||
git clone --depth=1 --branch="${CONTAINER_GIT_BRANCH}" \ | ||
"${CONTAINER_GIT_REPO}" "${CONTAINER_GIT_BRANCH}" | ||
cd "${CONTAINER_GIT_BRANCH}" | ||
|
||
make KIND=${KIND} OS_NAME=${OS_NAME} PACKAGE_SOURCE=${PACKAGE_SOURCE} \ | ||
BUILD_ARCH=${OS_ARCH} build-image | ||
|
||
IMAGE=$(./hack/build-image --kind ${KIND} --distro-base ${OS_NAME} \ | ||
--package-source ${PACKAGE_SOURCE} --arch ${OS_ARCH} \ | ||
--print) | ||
|
||
./hack/build-image --retag --container-engine ${CONTAINER_CMD} \ | ||
--repo-base ${IMG_REGISTRY_BASE} --no-distro-qualified \ | ||
-i ${IMAGE} | ||
|
||
podman login -u ${IMG_REGISTRY_USER} \ | ||
-p ${IMG_REGISTRY_PASSWORD} ${IMG_REGISTRY} | ||
|
||
./hack/build-image --push --container-engine ${CONTAINER_CMD} --verbose \ | ||
--push-state "exists" --push-selected-tags ${PUSH_TAGS_SELECTION} \ | ||
-i ${IMG_REGISTRY_BASE}/${IMAGE} | ||
|
||
podman logout ${IMG_REGISTRY} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.