From fc737e515d4690f76355d00071671c15ceb51113 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 15 Apr 2026 18:07:32 +0530 Subject: [PATCH 01/16] replication time log increase from 10 to 20 --- mongodb_consistent_backup/Replication/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodb_consistent_backup/Replication/__init__.py b/mongodb_consistent_backup/Replication/__init__.py index ae4d1189..d289a619 100644 --- a/mongodb_consistent_backup/Replication/__init__.py +++ b/mongodb_consistent_backup/Replication/__init__.py @@ -3,7 +3,7 @@ def config(parser): - parser.add_argument("--replication.max_lag_secs", dest="replication.max_lag_secs", default=10, type=int, + parser.add_argument("--replication.max_lag_secs", dest="replication.max_lag_secs", default=20, type=int, help="Max lag of backup replica(s) in seconds (default: 10)") parser.add_argument("--replication.min_priority", dest="replication.min_priority", default=0, type=int, help="Min priority of secondary members for backup (default: 0)") From 2ed3a21a6cd107bfa6cfac019bcaffcc5dbfb093 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 15 Apr 2026 18:19:55 +0530 Subject: [PATCH 02/16] bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4ea2b1f4..ac9f79ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.9 +1.4.10 From 853c8ce3b41fa915582af4d2f96b88b9df5b77a7 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Fri, 17 Apr 2026 15:54:40 +0530 Subject: [PATCH 03/16] try --- .circleci/config.yml | 38 +++++++++++++++++++++++++++++--------- scripts/build.sh | 23 ++++++++++++++++++++--- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe18aef5..51f7249e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,20 +36,41 @@ jobs: - run: name: set version and build the rpm command: | - set -x + set -xeuo pipefail version=$(cat VERSION) - echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION + build_version="${version}.${CIRCLE_BUILD_NUM}" + echo "${build_version}" > VERSION make rpm git config user.email "dev@objectrocket.com" git config user.name "objectrocketdev" - git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD - rpm -qa | grep ssh - rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 - git push --tags origin - mkdir mongodb_consistent_backup_rpm - cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ + if git rev-parse -q --verify "refs/tags/${build_version}" >/dev/null; then + echo "Git tag ${build_version} already exists locally; skipping tag creation." + else + git tag -a "${build_version}" -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD + fi + + rpm -qa | grep ssh || true + libssh2_pkg=$(rpm -q libssh2 2>/dev/null || true) + if [ -n "${libssh2_pkg}" ]; then + rpm -ql "${libssh2_pkg}" + fi + + if git ls-remote --exit-code --tags origin "refs/tags/${build_version}" >/dev/null 2>&1; then + echo "Git tag ${build_version} already exists on origin; skipping push." + else + git push origin "refs/tags/${build_version}" + fi + + mkdir -p mongodb_consistent_backup_rpm + built_rpm=$(find build/rpm/RPMS/x86_64 -maxdepth 1 -type f -name "mongodb_consistent_backup-${build_version}-1.*.x86_64.rpm" | head -n 1) + if [ -z "${built_rpm}" ]; then + echo "Built RPM for version ${build_version} not found." + find build/rpm/RPMS -maxdepth 2 -type f -name '*.rpm' + exit 1 + fi + cp "${built_rpm}" mongodb_consistent_backup_rpm/ - save_cache: paths: @@ -59,4 +80,3 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm destination: mongodb_consistent_backup - diff --git a/scripts/build.sh b/scripts/build.sh index 2ae49070..87ecfd26 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -103,14 +103,31 @@ if [ -d ${srcdir} ]; then pip_flags="--download-cache=${pipdir}" ${venvdir}/bin/python2.7 ${venvdir}/bin/pip --help | grep -q '\-\-cache\-dir' [ $? = 0 ] && pip_flags="--cache-dir=${pipdir}" - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "requests" + + # Keep the Python 2 build bootstrap deterministic. Modern releases of these + # tools no longer support Python 2, and older pip builds do not always + # resolve the last compatible versions correctly. + bootstrap_pip=${BOOTSTRAP_PIP_VERSION:-pip<21} + bootstrap_setuptools=${BOOTSTRAP_SETUPTOOLS_VERSION:-setuptools<45} + bootstrap_wheel=${BOOTSTRAP_WHEEL_VERSION:-wheel<0.38} + bootstrap_requests=${BOOTSTRAP_REQUESTS_VERSION:-requests==2.27.1} + bootstrap_pex=${BOOTSTRAP_PEX_VERSION:-pex==2.1.120} + + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} \ + "${bootstrap_pip}" "${bootstrap_setuptools}" "${bootstrap_wheel}" + if [ $? -gt 0 ]; then + echo "Failed to pin Python 2 build tooling (pip/setuptools/wheel)!" + exit 1 + fi + + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "${bootstrap_requests}" if [ $? -gt 0 ]; then echo "Failed to install 'requests'!" exit 1 fi - # build work with pex<=2.1.120 as of 23 feb 2023 - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "pex<=2.1.120" + # PEX 2.1.120 is the last known-good version for this Python 2 build flow. + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "${bootstrap_pex}" if [ $? -gt 0 ]; then echo "Failed to install pex utility for building!" exit 1 From f475ee399c656893245c29dbfe63ad82061a1107 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Fri, 17 Apr 2026 16:14:18 +0530 Subject: [PATCH 04/16] revert changes --- .circleci/config.yml | 38 +++++++++----------------------------- scripts/build.sh | 23 +++-------------------- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51f7249e..fe18aef5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,41 +36,20 @@ jobs: - run: name: set version and build the rpm command: | - set -xeuo pipefail + set -x version=$(cat VERSION) - build_version="${version}.${CIRCLE_BUILD_NUM}" - echo "${build_version}" > VERSION + echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION make rpm git config user.email "dev@objectrocket.com" git config user.name "objectrocketdev" + git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD + rpm -qa | grep ssh + rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 + git push --tags origin - if git rev-parse -q --verify "refs/tags/${build_version}" >/dev/null; then - echo "Git tag ${build_version} already exists locally; skipping tag creation." - else - git tag -a "${build_version}" -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD - fi - - rpm -qa | grep ssh || true - libssh2_pkg=$(rpm -q libssh2 2>/dev/null || true) - if [ -n "${libssh2_pkg}" ]; then - rpm -ql "${libssh2_pkg}" - fi - - if git ls-remote --exit-code --tags origin "refs/tags/${build_version}" >/dev/null 2>&1; then - echo "Git tag ${build_version} already exists on origin; skipping push." - else - git push origin "refs/tags/${build_version}" - fi - - mkdir -p mongodb_consistent_backup_rpm - built_rpm=$(find build/rpm/RPMS/x86_64 -maxdepth 1 -type f -name "mongodb_consistent_backup-${build_version}-1.*.x86_64.rpm" | head -n 1) - if [ -z "${built_rpm}" ]; then - echo "Built RPM for version ${build_version} not found." - find build/rpm/RPMS -maxdepth 2 -type f -name '*.rpm' - exit 1 - fi - cp "${built_rpm}" mongodb_consistent_backup_rpm/ + mkdir mongodb_consistent_backup_rpm + cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ - save_cache: paths: @@ -80,3 +59,4 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm destination: mongodb_consistent_backup + diff --git a/scripts/build.sh b/scripts/build.sh index 87ecfd26..2ae49070 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -103,31 +103,14 @@ if [ -d ${srcdir} ]; then pip_flags="--download-cache=${pipdir}" ${venvdir}/bin/python2.7 ${venvdir}/bin/pip --help | grep -q '\-\-cache\-dir' [ $? = 0 ] && pip_flags="--cache-dir=${pipdir}" - - # Keep the Python 2 build bootstrap deterministic. Modern releases of these - # tools no longer support Python 2, and older pip builds do not always - # resolve the last compatible versions correctly. - bootstrap_pip=${BOOTSTRAP_PIP_VERSION:-pip<21} - bootstrap_setuptools=${BOOTSTRAP_SETUPTOOLS_VERSION:-setuptools<45} - bootstrap_wheel=${BOOTSTRAP_WHEEL_VERSION:-wheel<0.38} - bootstrap_requests=${BOOTSTRAP_REQUESTS_VERSION:-requests==2.27.1} - bootstrap_pex=${BOOTSTRAP_PEX_VERSION:-pex==2.1.120} - - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} \ - "${bootstrap_pip}" "${bootstrap_setuptools}" "${bootstrap_wheel}" - if [ $? -gt 0 ]; then - echo "Failed to pin Python 2 build tooling (pip/setuptools/wheel)!" - exit 1 - fi - - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "${bootstrap_requests}" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "requests" if [ $? -gt 0 ]; then echo "Failed to install 'requests'!" exit 1 fi - # PEX 2.1.120 is the last known-good version for this Python 2 build flow. - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "${bootstrap_pex}" + # build work with pex<=2.1.120 as of 23 feb 2023 + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "pex<=2.1.120" if [ $? -gt 0 ]; then echo "Failed to install pex utility for building!" exit 1 From 04817e8d6d45b276ff4d99f25d06655a3169dcdf Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Tue, 21 Apr 2026 17:11:21 +0530 Subject: [PATCH 05/16] try --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ac9f79ca..4ea2b1f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.10 +1.4.9 From 72ba3418f6cee1b4c1860bd55fc23bd8325a6129 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Tue, 21 Apr 2026 17:32:04 +0530 Subject: [PATCH 06/16] try --- .circleci/config.yml | 2 +- scripts/build.sh | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe18aef5..942971a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ jobs: - run: name: set version and build the rpm + no_output_timeout: 20m command: | set -x version=$(cat VERSION) @@ -59,4 +60,3 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm destination: mongodb_consistent_backup - diff --git a/scripts/build.sh b/scripts/build.sh index 2ae49070..9ff25a2f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,6 +2,9 @@ set -x +pip_verbose_flags="-vvv" +pex_verbose_flags="-vvv" + readlink_bin=readlink cp_bin=cp if [[ "`uname`" =~ "Darwin" ]]; then @@ -103,14 +106,16 @@ if [ -d ${srcdir} ]; then pip_flags="--download-cache=${pipdir}" ${venvdir}/bin/python2.7 ${venvdir}/bin/pip --help | grep -q '\-\-cache\-dir' [ $? = 0 ] && pip_flags="--cache-dir=${pipdir}" - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "requests" + echo "Installing requests with verbose pip logging" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_verbose_flags} ${pip_flags} "requests" if [ $? -gt 0 ]; then echo "Failed to install 'requests'!" exit 1 fi # build work with pex<=2.1.120 as of 23 feb 2023 - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "pex<=2.1.120" + echo "Installing pex with verbose pip logging" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_verbose_flags} ${pip_flags} "pex<=2.1.120" if [ $? -gt 0 ]; then echo "Failed to install pex utility for building!" exit 1 @@ -122,7 +127,8 @@ if [ -d ${srcdir} ]; then find ${pexdir} -type f -name "${mod_name}-*.whl" -delete fi [ ! -d ${bindir} ] && mkdir -p ${bindir} - ${venvdir}/bin/python2.7 ${venvdir}/bin/pex -o ${output_file} --no-emit-warnings -m ${mod_name} -r ${require_file} --pex-root=${pexdir} ${builddir} + echo "Building pex executable with verbose logging" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pex ${pex_verbose_flags} -o ${output_file} --no-emit-warnings -m ${mod_name} -r ${require_file} --pex-root=${pexdir} ${builddir} if [ $? -lt 1 ] && [ -x ${output_file} ]; then echo "pex executable written to '$output_file'" else From 5dfec10525ed1a05b66e0d9fea38eeed4bd6d47e Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 09:43:39 +0530 Subject: [PATCH 07/16] revert changes --- .circleci/config.yml | 1 - scripts/build.sh | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 942971a0..babafcdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,6 @@ jobs: - run: name: set version and build the rpm - no_output_timeout: 20m command: | set -x version=$(cat VERSION) diff --git a/scripts/build.sh b/scripts/build.sh index 9ff25a2f..2ae49070 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,9 +2,6 @@ set -x -pip_verbose_flags="-vvv" -pex_verbose_flags="-vvv" - readlink_bin=readlink cp_bin=cp if [[ "`uname`" =~ "Darwin" ]]; then @@ -106,16 +103,14 @@ if [ -d ${srcdir} ]; then pip_flags="--download-cache=${pipdir}" ${venvdir}/bin/python2.7 ${venvdir}/bin/pip --help | grep -q '\-\-cache\-dir' [ $? = 0 ] && pip_flags="--cache-dir=${pipdir}" - echo "Installing requests with verbose pip logging" - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_verbose_flags} ${pip_flags} "requests" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "requests" if [ $? -gt 0 ]; then echo "Failed to install 'requests'!" exit 1 fi # build work with pex<=2.1.120 as of 23 feb 2023 - echo "Installing pex with verbose pip logging" - ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_verbose_flags} ${pip_flags} "pex<=2.1.120" + ${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} "pex<=2.1.120" if [ $? -gt 0 ]; then echo "Failed to install pex utility for building!" exit 1 @@ -127,8 +122,7 @@ if [ -d ${srcdir} ]; then find ${pexdir} -type f -name "${mod_name}-*.whl" -delete fi [ ! -d ${bindir} ] && mkdir -p ${bindir} - echo "Building pex executable with verbose logging" - ${venvdir}/bin/python2.7 ${venvdir}/bin/pex ${pex_verbose_flags} -o ${output_file} --no-emit-warnings -m ${mod_name} -r ${require_file} --pex-root=${pexdir} ${builddir} + ${venvdir}/bin/python2.7 ${venvdir}/bin/pex -o ${output_file} --no-emit-warnings -m ${mod_name} -r ${require_file} --pex-root=${pexdir} ${builddir} if [ $? -lt 1 ] && [ -x ${output_file} ]; then echo "pex executable written to '$output_file'" else From e75e1c2c9e3f4e6f8ef83f3d95629a88393561d0 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 09:50:06 +0530 Subject: [PATCH 08/16] remove space --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index babafcdb..14b8bf42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,4 +58,4 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm - destination: mongodb_consistent_backup + destination: mongodb_consistent_backup \ No newline at end of file From 3b8d5ce6e990050cabc30731c91f9c0c61301602 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 10:02:36 +0530 Subject: [PATCH 09/16] try --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4ea2b1f4..3659506c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.9 +1.4.10 \ No newline at end of file From 399a48f86faca7b500900cb0b79fa9917600411a Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 10:03:44 +0530 Subject: [PATCH 10/16] try --- .circleci/config.yml | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 14b8bf42..68404bff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,4 +58,4 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm - destination: mongodb_consistent_backup \ No newline at end of file + destination: mongodb_consistent_backup \ No newline at end of file diff --git a/VERSION b/VERSION index 3659506c..dcfd3ea3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.10 \ No newline at end of file +1.4.10 \ No newline at end of file From f32f6d7497ec47ac7650283f99a3261ba6128a13 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 10:32:44 +0530 Subject: [PATCH 11/16] try --- .circleci/config.yml | 4 ++-- VERSION | 2 +- scripts/build.sh | 39 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68404bff..46cb8847 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: name: set version and build the rpm command: | set -x - version=$(cat VERSION) + version=$(tr -d '\r\n' < VERSION) echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION make rpm @@ -58,4 +58,4 @@ jobs: - store_artifacts: path: mongodb_consistent_backup_rpm - destination: mongodb_consistent_backup \ No newline at end of file + destination: mongodb_consistent_backup diff --git a/VERSION b/VERSION index dcfd3ea3..ac9f79ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.10 \ No newline at end of file +1.4.10 diff --git a/scripts/build.sh b/scripts/build.sh index 2ae49070..fb90c841 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -29,6 +29,30 @@ require_file=${builddir}/requirements.txt version_file=${builddir}/VERSION git_commit=${GIT_COMMIT:-unknown} +replace_version_placeholder() { + local file_path=$1 + local resolved_version=$2 + + ${python_bin} - "$file_path" "$resolved_version" <<'PY' +import sys + +file_path = sys.argv[1] +resolved_version = sys.argv[2] +placeholder = "#.#.#" + +with open(file_path, "r") as handle: + content = handle.read() + +if placeholder not in content: + sys.stderr.write("Failed to find version placeholder in %s\n" % file_path) + sys.exit(1) + +with open(file_path, "w") as handle: + handle.write(content.replace(placeholder, resolved_version)) +PY + return $? +} + python_bin=${PYTHON_BIN} if [ -z "$python_bin" ]; then if [[ "`uname`" =~ "Darwin" ]]; then @@ -73,13 +97,22 @@ if [ -d ${srcdir} ]; then # Replace version number in setup.py and mongodb_consistent_backup/__init__.py with number in VERSION: if [ -f "$version_file" ]; then - version=$(cat ${version_file}) + version=$(tr -d '\r\n' < ${version_file}) if [ -z "$version" ]; then echo "Cannot get version from file $version_file!" exit 1 else - sed -i -e s@\#.\#.\#@${version}@g ${builddir}/setup.py - sed -i -e s@\#.\#.\#@${version}@g ${builddir}/${mod_name}/__init__.py + replace_version_placeholder ${builddir}/setup.py ${version} + if [ $? -gt 0 ]; then + echo "Failed to stamp version into ${builddir}/setup.py!" + exit 1 + fi + + replace_version_placeholder ${builddir}/${mod_name}/__init__.py ${version} + if [ $? -gt 0 ]; then + echo "Failed to stamp version into ${builddir}/${mod_name}/__init__.py!" + exit 1 + fi fi else echo "Cannot find version file $version_file!" From b1b0eaf948b4a834635bf192ee008519026f263e Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 10:43:46 +0530 Subject: [PATCH 12/16] try --- .circleci/config.yml | 2 +- scripts/build.sh | 39 +++------------------------------------ 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46cb8847..babafcdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: name: set version and build the rpm command: | set -x - version=$(tr -d '\r\n' < VERSION) + version=$(cat VERSION) echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION make rpm diff --git a/scripts/build.sh b/scripts/build.sh index fb90c841..2ae49070 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -29,30 +29,6 @@ require_file=${builddir}/requirements.txt version_file=${builddir}/VERSION git_commit=${GIT_COMMIT:-unknown} -replace_version_placeholder() { - local file_path=$1 - local resolved_version=$2 - - ${python_bin} - "$file_path" "$resolved_version" <<'PY' -import sys - -file_path = sys.argv[1] -resolved_version = sys.argv[2] -placeholder = "#.#.#" - -with open(file_path, "r") as handle: - content = handle.read() - -if placeholder not in content: - sys.stderr.write("Failed to find version placeholder in %s\n" % file_path) - sys.exit(1) - -with open(file_path, "w") as handle: - handle.write(content.replace(placeholder, resolved_version)) -PY - return $? -} - python_bin=${PYTHON_BIN} if [ -z "$python_bin" ]; then if [[ "`uname`" =~ "Darwin" ]]; then @@ -97,22 +73,13 @@ if [ -d ${srcdir} ]; then # Replace version number in setup.py and mongodb_consistent_backup/__init__.py with number in VERSION: if [ -f "$version_file" ]; then - version=$(tr -d '\r\n' < ${version_file}) + version=$(cat ${version_file}) if [ -z "$version" ]; then echo "Cannot get version from file $version_file!" exit 1 else - replace_version_placeholder ${builddir}/setup.py ${version} - if [ $? -gt 0 ]; then - echo "Failed to stamp version into ${builddir}/setup.py!" - exit 1 - fi - - replace_version_placeholder ${builddir}/${mod_name}/__init__.py ${version} - if [ $? -gt 0 ]; then - echo "Failed to stamp version into ${builddir}/${mod_name}/__init__.py!" - exit 1 - fi + sed -i -e s@\#.\#.\#@${version}@g ${builddir}/setup.py + sed -i -e s@\#.\#.\#@${version}@g ${builddir}/${mod_name}/__init__.py fi else echo "Cannot find version file $version_file!" From 679df02818a4ab444eb308561dbce6ab35552965 Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 14:47:50 +0530 Subject: [PATCH 13/16] try --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index babafcdb..576facde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ jobs: - run: name: set version and build the rpm + no_output_timeout: 20m command: | set -x version=$(cat VERSION) @@ -46,7 +47,7 @@ jobs: git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD rpm -qa | grep ssh rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 - git push --tags origin + git push --tags origin -vvv mkdir mongodb_consistent_backup_rpm cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ From 59ae7a45ef08613ae9ea52846908992e7121820e Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 15:16:56 +0530 Subject: [PATCH 14/16] try --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 576facde..aaa52193 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ jobs: git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD rpm -qa | grep ssh rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 - git push --tags origin -vvv + git push --tags origin -v mkdir mongodb_consistent_backup_rpm cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ From de8bb615e452c50188c35a4b2ec63ca11deb145d Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 15:34:45 +0530 Subject: [PATCH 15/16] try --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aaa52193..156be629 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ jobs: git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD rpm -qa | grep ssh rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 - git push --tags origin -v + git push --tags origin -vv mkdir mongodb_consistent_backup_rpm cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ From de775b34e228494a064814f0e8c59454c118168b Mon Sep 17 00:00:00 2001 From: Sunny-Drall Date: Wed, 22 Apr 2026 15:41:29 +0530 Subject: [PATCH 16/16] some logs --- .circleci/config.yml | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 156be629..0b0b81a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,20 +37,50 @@ jobs: name: set version and build the rpm no_output_timeout: 20m command: | - set -x + set -ex + + heartbeat() { + label="$1" + while true; do + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] still running: ${label}" + sleep 60 + done + } + + run_with_heartbeat() { + label="$1" + shift + + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] starting: ${label}" + heartbeat "${label}" & + heartbeat_pid=$! + + "$@" + status=$? + + kill "${heartbeat_pid}" 2>/dev/null || true + wait "${heartbeat_pid}" 2>/dev/null || true + + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] finished: ${label} (exit ${status})" + return ${status} + } + version=$(cat VERSION) echo "${version}.${CIRCLE_BUILD_NUM}" > VERSION - make rpm + run_with_heartbeat "make rpm" make rpm git config user.email "dev@objectrocket.com" git config user.name "objectrocketdev" git tag -a $(cat VERSION) -m "Tagged by ${CIRCLE_BUILD_URL}" HEAD rpm -qa | grep ssh rpm -ql libssh2-1.4.2-2.el6_7.1.x86_64 - git push --tags origin -vv + run_with_heartbeat "git push --tags origin" git push --tags origin -vv + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] creating artifact directory: mongodb_consistent_backup_rpm" mkdir mongodb_consistent_backup_rpm + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] copying rpm artifact from /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm" cp /root/repo/build/rpm/RPMS/x86_64/mongodb_consistent_backup-$(cat VERSION)-1.el6.x86_64.rpm mongodb_consistent_backup_rpm/ + echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] artifact copy complete" - save_cache: paths: