4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname ${SCRIPTDIR}))/env/lib"
7 source $LIBDIR/logging.sh
8 source $LIBDIR/common.sh
10 # This may be used to update the in-place Bare Metal Operator YAML
11 # files from the upstream project
12 function build_source {
13 clone_baremetal_operator_repository
14 KUSTOMIZATION_FILES=$(find ${BMOPATH}/config/kustomization.yaml ${BMOPATH}/config/{namespace,default,crd,rbac,manager,webhook,certmanager} -type f)
15 for src in ${KUSTOMIZATION_FILES}; do
16 dst=${src/${BMOPATH}\/config/${SCRIPTDIR}\/base}
17 mkdir -p $(dirname ${dst})
23 kustomize build ${SCRIPTDIR}/icn | kubectl apply -f -
24 kubectl wait --for=condition=Available --timeout=600s deployment/baremetal-operator-controller-manager -n baremetal-operator-system
28 kustomize build ${SCRIPTDIR}/icn | kubectl delete -f -
32 "build-source") build_source ;;
36 Usage: $(basename $0) COMMAND
39 build-source - Rebuild the in-tree Bare Metal Operator YAML files
40 clean - Remove the Bare Metal Operator
41 deploy - Deploy the Bare Metal Operator