Skip to content

Commit

Permalink
change components.sh to run only the selected comoponent
Browse files Browse the repository at this point in the history
Currently components.sh goes over all components and bumps if needed.
Let's add a new parameter COMPONENTS to run with make bump-components.
Also, bump-components.sh is changed to work only per this component.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
  • Loading branch information
RamLavi committed Jul 7, 2020
1 parent 36dd2d1 commit 86a8e92
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ gen-k8s-check: $(apis_sources)
./hack/verify-codegen.sh
touch $@

bump-all:
./hack/components/bump-all.sh
bump-components:
COMPONENTS="${COMPONENTS}" ./hack/components/bump-components.sh

bump-kubevirtci:
rm -rf _kubevirtci
Expand Down
19 changes: 0 additions & 19 deletions hack/components/bump-all.sh

This file was deleted.

55 changes: 55 additions & 0 deletions hack/components/bump-components.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash

set -xeo pipefail

CNAO_VERSION=${VERSION} # Exported from Makefile

echo 'Setup temporary Go path'
export GOPATH=${PWD}/_components/go
mkdir -p $GOPATH
export PATH=${GOPATH}/bin:${PATH}

function usage() {
echo "Usage: COMPONENTS='<component> <component>...' components.sh\n"
echo "supported components are knmstate|kubemacpool|macvtap|all"
echo "where all will select all components"
}

function bump_component() {
local component=$1
echo $component
source hack/components/bump-${component}.sh
}

if [ -z "${COMPONENTS}" ]; then
echo "Error, no component chosen"
usage
exit
fi

#input parameter parsing
for component in ${COMPONENTS}; do
echo component=${component}
case "${component}" in
knmstate)
bump_component knmstate
;;
kubemacpool)
bump_component kubemacpool
;;
macvtap)
bump_component macvtap
;;
all)
bump_component knmstate
bump_component kubemacpool
bump_component macvtap
exit
;;
*)
echo "Error, non valid component chosen"
usage
shift
;;
esac
done

0 comments on commit 86a8e92

Please sign in to comment.