From 325cebef06ba59694ccf60869b755472ffb5b9f2 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 23 Jun 2022 12:40:33 -0400 Subject: [PATCH] ceph*setup: Rewrite the src/ceph_version file to accurately reflect release type All Ceph binaries are currently being built with this to say "stable" Signed-off-by: David Galloway --- ceph-dev-new-setup/build/build | 2 ++ ceph-dev-setup/build/build | 2 ++ ceph-setup/build/build | 2 ++ scripts/build_utils.sh | 16 ++++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/ceph-dev-new-setup/build/build b/ceph-dev-new-setup/build/build index 07a304e92..79392beda 100644 --- a/ceph-dev-new-setup/build/build +++ b/ceph-dev-new-setup/build/build @@ -81,6 +81,8 @@ echo current version $cephver srcdir=`pwd` +rewrite_ceph_version_file + if [ -d "$releasedir/$cephver" ]; then echo "$releasedir/$cephver already exists; reuse that release tarball" else diff --git a/ceph-dev-setup/build/build b/ceph-dev-setup/build/build index 5c5af0dc7..5475644b0 100644 --- a/ceph-dev-setup/build/build +++ b/ceph-dev-setup/build/build @@ -74,6 +74,8 @@ echo current version $cephver srcdir=`pwd` +rewrite_ceph_version_file + if [ -d "$releasedir/$cephver" ]; then echo "$releasedir/$cephver already exists; reuse that release tarball" else diff --git a/ceph-setup/build/build b/ceph-setup/build/build index 05fe2161a..e4c46e6ae 100644 --- a/ceph-setup/build/build +++ b/ceph-setup/build/build @@ -72,6 +72,8 @@ echo current version $cephver srcdir=`pwd` +rewrite_ceph_version_file + if [ -d "$releasedir/$cephver" ]; then echo "$releasedir/$cephver already exists; reuse that release tarball" else diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index eb92b3232..806562831 100755 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -1657,3 +1657,19 @@ function set_centos_python3_version() { sudo dnf reinstall -y $EXPECTED_PYTHON3_VERSION || sudo dnf install -y $EXPECTED_PYTHON3_VERSION sudo ln -fs /usr/bin/$EXPECTED_PYTHON3_VERSION /usr/bin/python3 } + +# rewrites src/ceph_release with the appropriate release type. +# in the ceph-setup job, $RELEASE_TYPE will be defined. +# in ceph-dev-{setup,new-setup}, it's not defined so it's a dev release +function rewrite_ceph_version_file() { + if [ "$RELEASE_TYPE" == "STABLE" ]; then + echo "Writing 'stable' to src/ceph_release file" + sed -i '$ s/.*/stable/g' src/ceph_release + elif [ "$RELEASE_TYPE" == "RELEASE_CANDIDATE" ]; then + echo "Writing 'rc' to src/ceph_release file" + sed -i '$ s/.*/rc/g' src/ceph_release + else + echo "Writing 'dev' to src/ceph_release file" + sed -i '$ s/.*/dev/g' src/ceph_release + fi +}