diff options
-rw-r--r-- | container/Containerfile | 13 | ||||
-rwxr-xr-x | container/build.sh | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/container/Containerfile b/container/Containerfile index 2f75c8c6ce6..7224028723d 100644 --- a/container/Containerfile +++ b/container/Containerfile @@ -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 diff --git a/container/build.sh b/container/build.sh index 30f0bdb0e0a..bf538fb72b8 100755 --- a/container/build.sh +++ b/container/build.sh @@ -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}}') |