From 8c01aab7f4a6170e5a7f22bfbb133ac4e94d0e86 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Fri, 22 Aug 2025 10:45:41 -0500 Subject: [PATCH] Fixed version installed by cf-remote via fast-build(Jenkinsfile) on LTS branches On LTS branches, BRANCH=3.21 without the .x suffix and cf-remote doesn't understand this. Ticket: ENT-12581 Changelog: none --- generator/build/main.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generator/build/main.sh b/generator/build/main.sh index ef99ba956..97634aef4 100644 --- a/generator/build/main.sh +++ b/generator/build/main.sh @@ -84,7 +84,17 @@ if [ "$PACKAGE_JOB" = "cf-remote" ]; then # shellcheck source=/dev/null source /etc/os-release rm -rf ~/.cfengine/cf-remote/packages # to ensure we only get one - cf-remote --version "$BRANCH" download "${ID}$(echo "${VERSION_ID}" | cut -d. -f1)" hub "$(uname -m)" + # in case of LTS branches like 3.21 (without .x since we are in documentation repo) need to add on .x + if [ "$(expr "$BRANCH" : ".*.x")" = 0 ]; then + if [ "$BRANCH" = "master" ]; then + _VERSION=master + else + _VERSION="$BRANCH".x + fi + else + _VERSION="$BRANCH" # in case someone copy/pastes this to a repo besides documentation + fi + cf-remote --version "$_VERSION" download "${ID}$(echo "${VERSION_ID}" | cut -d. -f1)" hub "$(uname -m)" find "$HOME/.cfengine" # debug find "$HOME/.cfengine" -name '*.deb' -print0 | xargs -0 -I{} cp {} cfengine-nova-hub.deb else