Skip to content

Commit 840df1d

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

File tree

1 file changed

+41
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)