Skip to content

Commit 7ee701e

Browse files
committed
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 (cherry picked from commit 8c01aab)
1 parent ae029c8 commit 7ee701e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

generator/build/main.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,17 @@ if [ "$PACKAGE_JOB" = "cf-remote" ]; then
8484
# shellcheck source=/dev/null
8585
source /etc/os-release
8686
rm -rf ~/.cfengine/cf-remote/packages # to ensure we only get one
87-
cf-remote --version "$BRANCH" download "${ID}$(echo "${VERSION_ID}" | cut -d. -f1)" hub "$(uname -m)"
87+
# in case of LTS branches like 3.21 (without .x since we are in documentation repo) need to add on .x
88+
if [ "$(expr "$BRANCH" : ".*.x")" = 0 ]; then
89+
if [ "$BRANCH" = "master" ]; then
90+
_VERSION=master
91+
else
92+
_VERSION="$BRANCH".x
93+
fi
94+
else
95+
_VERSION="$BRANCH" # in case someone copy/pastes this to a repo besides documentation
96+
fi
97+
cf-remote --version "$_VERSION" download "${ID}$(echo "${VERSION_ID}" | cut -d. -f1)" hub "$(uname -m)"
8898
find "$HOME/.cfengine" # debug
8999
find "$HOME/.cfengine" -name '*.deb' -print0 | xargs -0 -I{} cp {} cfengine-nova-hub.deb
90100
else

0 commit comments

Comments
 (0)