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
14 kubectl get all -n ${NAMEPREFIX}-system
17 # This may be used to update the in-place Ironic YAML files from the
18 # upstream project. We cannot use the upstream sources directly as
19 # they require an envsubst step before kustomize build.
20 function build_source {
21 clone_baremetal_operator_repository
23 KUSTOMIZATION_FILES=$(find ${BMOPATH}/ironic-deployment/{default,ironic} -type f)
24 for src in ${KUSTOMIZATION_FILES}; do
25 dst=${src/${BMOPATH}\/ironic-deployment/${SCRIPTDIR}\/base}
26 mkdir -p $(dirname ${dst})
27 envsubst <${src} >${dst}
29 sed -i -e '/name: quay.io\/metal3-io\/ironic/{n;s/newTag:.*/newTag: '"${BMO_VERSION}"'/;}' ${SCRIPTDIR}/icn/kustomization.yaml
34 kustomize build ${SCRIPTDIR}/icn | kubectl apply -f -
35 kubectl wait --for=condition=Available --timeout=600s deployment/${NAMEPREFIX}-ironic -n ${NAMEPREFIX}-system
39 kustomize build ${SCRIPTDIR}/icn | kubectl delete -f -
43 "build-source") build_source ;;
47 Usage: $(basename $0) COMMAND
50 build-source - Rebuild the in-tree Ironic YAML files
52 deploy - Deploy Ironic