File tree Expand file tree Collapse file tree 7 files changed +29
-7
lines changed
Expand file tree Collapse file tree 7 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ ifneq ($(CLEAN_BUILD),)
4848endif
4949
5050GOLANGCI_LINT_VERSION = v1.61.0
51+ BASH_VERSION = v4.2.0
5152YQ_VERSION = v4.43.1
5253
5354# build a single arch target provided as argument
@@ -151,6 +152,7 @@ commands: ## Generate either oc or kubectl plugins and add them to build folder
151152 PULL_POLICY=$(PULL_POLICY ) \
152153 AGENT_IMAGE=$(AGENT_IMAGE ) \
153154 VERSION=$(VERSION ) \
155+ REQUIRED_BASH_VERSION=$(BASH_VERSION ) \
154156 REQUIRED_YQ_VERSION=$(YQ_VERSION ) \
155157 SUPPORTED_ARCHS=$(MULTIARCH_TARGETS ) \
156158 ./scripts/inject.sh
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22source " ./scripts/functions.sh"
33source " ./scripts/dependencies_check.sh"
44
@@ -94,7 +94,8 @@ function metrics() {
9494if [[ ! " $* " =~ ^(.* )help| version(.* ) ]]; then
9595 required_yq_version=" v0.0.0"
9696 supported_archs=" "
97- check_dependencies " $required_yq_version " " $supported_archs "
97+ required_bash_version=" v0.0.0"
98+ check_dependencies " $required_yq_version " " $supported_archs " " $required_bash_version "
9899fi
99100
100101case " $1 " in
Original file line number Diff line number Diff line change @@ -30,6 +30,18 @@ function check_dependencies() {
3030 else
3131 echo " 'yq' is up to date (version $current_yq_version )."
3232 fi
33+
34+ current_bash_version=" v${BASH_VERSINFO[0]} .${BASH_VERSINFO[1]} .${BASH_VERSINFO[2]} "
35+ required_bash_version=" $3 "
36+ # Compare versions
37+ compare_versions " ${current_bash_version# v} " " ${required_bash_version# v} "
38+
39+ if [ " $result " -eq 0 ]; then
40+ echo " Please upgrade bash to $required_bash_version or up. Found version $current_bash_version ."
41+ exit 1
42+ else
43+ echo " 'bash' is up to date (version $current_bash_version )."
44+ fi
3345}
3446
3547function compare_versions() {
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22ADOC=./docs/netobserv_cli.adoc
33
44# Header
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22set -x
33
44cp -a ./commands/. ./tmp
3333 sed -i.bak " s/^version=.*/version=\" $VERSION \" /" ./tmp/netobserv
3434fi
3535
36+ if [ -z " $REQUIRED_BASH_VERSION " ]; then
37+ echo " require bash version is not set, keeping the current version"
38+ else
39+ echo " updating dependencies to check for bash $REQUIRED_BASH_VERSION "
40+ sed -i.bak " s/^required_bash_version=.*/required_bash_version=\" $REQUIRED_BASH_VERSION \" /" ./tmp/netobserv
41+ fi
42+
3643if [ -z " $REQUIRED_YQ_VERSION " ]; then
3744 echo " require yq version is not set, keeping the current version"
3845else
39- echo " updating dependencies_check to check for $REQUIRED_YQ_VERSION "
46+ echo " updating dependencies to check for yq $REQUIRED_YQ_VERSION "
4047 sed -i.bak " s/^required_yq_version=.*/required_yq_version=\" $REQUIRED_YQ_VERSION \" /" ./tmp/netobserv
4148fi
4249
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
33SHA=$( sha256sum netobserv-cli.tar.gz | awk ' {print $1}' )
44
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
33echo " Downloading frontend config from operator repo"
44curl " https://raw.githubusercontent.com/netobserv/network-observability-operator/refs/heads/main/controllers/consoleplugin/config/static-frontend-config.yaml" -o ./cmd/config.yaml
You can’t perform that action at this time.
0 commit comments