Skip to content

Commit 6e652b8

Browse files
committed
jobs/scripts: Add basic steps to build+push samba containers
1 parent 257d255 commit 6e652b8

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
CONTAINER_GIT_REPO="https://github.com/samba-in-kubernetes/samba-container"
4+
CONTAINER_GIT_BRANCH="main"
5+
CONTAINER_CMD=${CONTAINER_CMD:-podman}
6+
IMG_REGISTRY="quay.io"
7+
IMG_REGISTRY_BASE="${IMG_REGISTRY}/samba.org"
8+
# At the moment we are interested in pushing unqualified tags only for x86_64
9+
PUSH_TAGS_SELECTION=$([[ $OS_ARCH != "x86_64" ]] && echo "fqin" || echo "mixed")
10+
11+
# if anything fails, we'll abort
12+
set -e
13+
14+
dnf -y install git make podman
15+
16+
git clone --depth=1 --branch="${CONTAINER_GIT_BRANCH}" \
17+
"${CONTAINER_GIT_REPO}" "${CONTAINER_GIT_BRANCH}"
18+
cd "${CONTAINER_GIT_BRANCH}"
19+
20+
make KIND=${KIND} OS_NAME=${OS_NAME} PACKAGE_SOURCE=${PACKAGE_SOURCE} \
21+
BUILD_ARCH=${OS_ARCH} build-image
22+
23+
IMAGE=$(./hack/build-image --kind ${KIND} --distro-base ${OS_NAME} \
24+
--package-source ${PACKAGE_SOURCE} --arch ${OS_ARCH} \
25+
--print)
26+
27+
./hack/build-image --retag --container-engine ${CONTAINER_CMD} \
28+
--repo-base ${IMG_REGISTRY_BASE} --no-distro-qualified \
29+
-i ${IMAGE}
30+
31+
podman login -u ${SAMBA_ORG_QUAY_USER} \
32+
-p ${SAMBA_ORG_QUAY_PASSWORD} ${IMG_REGISTRY}
33+
34+
./hack/build-image --push --container-engine ${CONTAINER_CMD} --verbose \
35+
--push-state "exists" --push-selected-tags ${PUSH_TAGS_SELECTION} \
36+
-i ${IMG_REGISTRY_BASE}/${IMAGE}
37+
38+
podman logout ${IMG_REGISTRY}

0 commit comments

Comments
 (0)