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
12 # This may be used to update the in-place Ironic YAML files from the
13 # upstream project. We cannot use the upstream sources directly as
14 # they require an envsubst step before kustomize build.
15 function build_source {
16 clone_baremetal_operator_repository
18 KUSTOMIZATION_FILES=$(find ${BMOPATH}/ironic-deployment/{default,ironic} -type f)
19 for src in ${KUSTOMIZATION_FILES}; do
20 dst=${src/${BMOPATH}\/ironic-deployment/${SCRIPTDIR}\/base}
21 mkdir -p $(dirname ${dst})
22 envsubst <${src} >${dst}
28 kustomize build ${SCRIPTDIR}/icn | kubectl apply -f -
29 kubectl wait --for=condition=Available --timeout=600s deployment/${NAMEPREFIX}-ironic -n ${NAMEPREFIX}-system
33 kustomize build ${SCRIPTDIR}/icn | kubectl delete -f -
37 "build-source") build_source ;;
41 Usage: $(basename $0) COMMAND
44 build-source - Rebuild the in-tree Ironic YAML files
46 deploy - Deploy Ironic