]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
container/Containerfile, build.sh: Add PRERELEASE_USERNAME/PASSWORD
authorDan Mick <dan.mick@redhat.com>
Fri, 15 Nov 2024 01:49:15 +0000 (17:49 -0800)
committerDan Mick <dan.mick@redhat.com>
Thu, 5 Dec 2024 08:10:12 +0000 (00:10 -0800)
Used for accessing download.ceph.com

Signed-off-by: Dan Mick <dan.mick@redhat.com>
(cherry picked from commit 7374b9b1114da08f1fdb9dfcfe2ef37c2178c8f5)

container/Containerfile
container/build.sh

index 2f75c8c6ce62ce40ae06790fa9367ab33d55cff5..7224028723d99c37961846b0edbd5a06c25d0f39 100644 (file)
@@ -22,6 +22,10 @@ ARG OSD_FLAVOR="default"
 # (optional) Should be 'true' for CI builds (pull from shaman, etc.)
 ARG CI_CONTAINER="true"
 
+# creds for accessing prerelease packages on download.ceph.com for release builds
+ARG PRERELEASE_USERNAME ""
+ARG PRERELEASE_PASSWORD ""
+
 RUN /bin/echo -e "\
 FROM_IMAGE: ${FROM_IMAGE}\n\
 CEPH_REF: ${CEPH_REF}\n\
@@ -82,9 +86,14 @@ RUN set -x && \
         REPO_URL=$(curl -s "https://shaman.ceph.com/api/search/?project=ceph&distros=centos/9/${ARCH}&flavor=${OSD_FLAVOR}&ref=${CEPH_REF}&sha1=latest" | jq -r .[0].url) ;\
     else \
         IS_RELEASE=1 ;\
-        REPO_URL="http://download.ceph.com/rpm-${CEPH_REF}/el9/" ;\
+        REPO_URL="https://${PRERELEASE_USERNAME}:${PRERELEASE_PASSWORD}@download.ceph.com/prerelease/ceph/rpm-${CEPH_REF}/el9/" ;\
     fi && \
-    rpm -Uvh "$REPO_URL/noarch/ceph-release-1-${IS_RELEASE}.el9.noarch.rpm"
+    rpm -Uvh "$REPO_URL/noarch/ceph-release-1-${IS_RELEASE}.el9.noarch.rpm" ; \
+    if [[ IS_RELEASE ]] ; then \
+       sed -i "s;http://download.ceph.com/;https://${PRERELEASE_USERNAME}:${PRERELEASE_PASSWORD}@download.ceph.com/prerelease/ceph/;" /etc/yum.repos.d/ceph.repo ; \
+       dnf clean expire-cache ; \
+    fi
+
 
 # Copr repos
 # scikit for mgr-diskprediction-local
index 30f0bdb0e0a0c65d24d6827377ecbb588218a159..bf538fb72b8b5fd76d78c0df9a4d27631f407862 100755 (executable)
@@ -22,6 +22,8 @@ CONTAINER_REPO_HOSTNAME (quay.ceph.io, for CI, for instance)
 CONTAINER_REPO_ORGANIZATION (ceph-ci, for CI, for instance)
 CONTAINER_REPO_USERNAME
 CONTAINER_REPO_PASSWORD
+PRERELEASE_USERNAME for download.ceph.com:/prerelease/ceph
+PRERELEASE_PASSWORD
 
 For a release build: (from ceph.git, built and pushed to download.ceph.com)
 CI_CONTAINER: must be 'false'
@@ -99,6 +101,8 @@ podman build --pull=newer --squash -f $CFILE -t build.sh.output \
     --build-arg CEPH_REF=${BRANCH:-main} \
     --build-arg OSD_FLAVOR=${FLAVOR:-default} \
     --build-arg CI_CONTAINER=${CI_CONTAINER:-default} \
+    --build-arg PRERELEASE_USERNAME=${PRERELEASE_USERNAME} \
+    --build-arg PRERELEASE_PASSWORD=${PRERELEASE_PASSWORD} \
     2>&1 
 
 image_id=$(podman image ls localhost/build.sh.output --format '{{.ID}}')