diff --git a/02_configure_host.sh b/02_configure_host.sh index 64156c1bf..5b448d451 100755 --- a/02_configure_host.sh +++ b/02_configure_host.sh @@ -312,6 +312,19 @@ mkdir -p "${M3PATH}" detect_mismatch "${BMO_LOCAL_IMAGE:-}" "${BMOPATH}" clone_repo "${BMOREPO}" "${BMOBRANCH}" "${BMOPATH}" "${BMOCOMMIT}" +# In release-0.8 and earlier, we use deploy.sh instead of deploy-cli. +if [[ "${BMOBRANCH}" =~ release-0.(8|6|5) ]]; then + # Make symlink from deploy.sh to /usr/bin/deploy-cli + sudo ln -s "${BMOPATH}/tools/deploy.sh" /usr/bin/deploy-cli +else + # Install deploy-cli. + pushd "${BMOPATH}" + make deploy-cli + sudo install tools/bin/deploy-cli /usr/bin/ + export DEPLOY_TOOL="deploy-cli" + popd +fi + detect_mismatch "${CAPM3_LOCAL_IMAGE:-}" "${CAPM3PATH}" clone_repo "${CAPM3REPO}" "${CAPM3BRANCH}" "${CAPM3PATH}" "${CAPM3COMMIT}" diff --git a/03_launch_mgmt_cluster.sh b/03_launch_mgmt_cluster.sh index 44743a9af..2261d284a 100755 --- a/03_launch_mgmt_cluster.sh +++ b/03_launch_mgmt_cluster.sh @@ -51,7 +51,7 @@ launch_baremetal_operator() { pushd "${BMOPATH}" - # Deploy BMO using deploy.sh script + # Deploy BMO using deploy-cli if [[ "${EPHEMERAL_CLUSTER}" != "tilt" ]]; then # Update container images to use local ones if [[ -n "${BARE_METAL_OPERATOR_LOCAL_IMAGE:-}" ]]; then @@ -78,8 +78,9 @@ EOF echo "DEPLOY_ISO_URL=${DEPLOY_ISO_URL}" | sudo tee -a "${BMOPATH}/config/default/ironic.env" fi - # Deploy BMO using deploy.sh script - "${BMOPATH}/tools/deploy.sh" -b "${BMO_IRONIC_ARGS[@]}" + # Deploy BMO using deploy-cli + export BMOPATH + deploy-cli -b "${BMO_IRONIC_ARGS[@]}" # If BMO should run locally, scale down the deployment and run BMO if [[ "${BMO_RUN_LOCAL}" = "true" ]]; then @@ -236,8 +237,9 @@ EOF echo "Waiting for Ironic to become ready" retry sudo "${CONTAINER_RUNTIME}" exec ironic /bin/ironic-readiness else - # Deploy Ironic using deploy.sh script - "${BMOPATH}/tools/deploy.sh" -i "${BMO_IRONIC_ARGS[@]}" + # Deploy Ironic using deploy-cli + export BMOPATH + deploy-cli -i "${BMO_IRONIC_ARGS[@]}" fi popd } diff --git a/lib/common.sh b/lib/common.sh index 0eeaa20b3..03505b7b4 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -336,7 +336,6 @@ export IPXE_SOURCE_DIR="${IRONIC_DATA_DIR}/ipxe-source" export IRONIC_KEEPALIVED_IMAGE="${IRONIC_KEEPALIVED_IMAGE:-${CONTAINER_REGISTRY}/metal3-io/keepalived:${KEEPALIVED_TAG}}" export MARIADB_IMAGE="${MARIADB_IMAGE:-${CONTAINER_REGISTRY}/metal3-io/mariadb:${MARIADB_TAG}}" - # Enable ironic restart feature when the TLS certificate is updated export RESTART_CONTAINER_CERTIFICATE_UPDATED="${RESTART_CONTAINER_CERTIFICATE_UPDATED:-${IRONIC_TLS_SETUP}}" diff --git a/tests/roles/run_tests/tasks/move.yml b/tests/roles/run_tests/tasks/move.yml index ad3d78dca..555ca1431 100644 --- a/tests/roles/run_tests/tasks/move.yml +++ b/tests/roles/run_tests/tasks/move.yml @@ -114,21 +114,23 @@ # Install BMO - name: Install Baremetal Operator - shell: "{{ BMOPATH }}/tools/deploy.sh -b {{ BMO_IRONIC_ARGS }}" + shell: "deploy-cli -b {{ BMO_IRONIC_ARGS }}" environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" KUBECTL_ARGS: "{{ KUBECTL_ARGS }}" + BMOPATH: "{{ BMOPATH }}" args: chdir: "{{ BMOPATH }}" # Install Ironic - name: Install Ironic - shell: "{{ BMOPATH }}/tools/deploy.sh -i {{ BMO_IRONIC_ARGS }}" + shell: "deploy-cli -i {{ BMO_IRONIC_ARGS }}" environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" KUBECTL_ARGS: "{{ KUBECTL_ARGS }}" + BMOPATH: "{{ BMOPATH }}" args: chdir: "{{ BMOPATH }}" diff --git a/tests/roles/run_tests/tasks/move_back.yml b/tests/roles/run_tests/tasks/move_back.yml index 947544532..38dc7c481 100644 --- a/tests/roles/run_tests/tasks/move_back.yml +++ b/tests/roles/run_tests/tasks/move_back.yml @@ -11,10 +11,11 @@ # Install BMO in Source cluster - name: Install Baremetal Operator in Source cluster - shell: "{{ BMOPATH }}/tools/deploy.sh -b {{ BMO_IRONIC_ARGS }}" + shell: "deploy-cli -b {{ BMO_IRONIC_ARGS }}" environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" + BMOPATH: "{{ BMOPATH }}" args: chdir: "{{ BMOPATH }}" @@ -25,10 +26,11 @@ when: EPHEMERAL_CLUSTER == "kind" - name: Install Ironic in Source cluster (Ephemeral Cluster is minikube) - shell: "{{ BMOPATH }}/tools/deploy.sh -i {{ BMO_IRONIC_ARGS }}" + shell: "deploy-cli -i {{ BMO_IRONIC_ARGS }}" environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" + BMOPATH: "{{ BMOPATH }}" when: EPHEMERAL_CLUSTER == "minikube" args: chdir: "{{ BMOPATH }}" diff --git a/tests/roles/run_tests/vars/main.yml b/tests/roles/run_tests/vars/main.yml index 27e84296c..dd128f301 100644 --- a/tests/roles/run_tests/vars/main.yml +++ b/tests/roles/run_tests/vars/main.yml @@ -92,7 +92,7 @@ CAPM3_INSECURE_DIAGNOSTICS: "true" IPAM_DIAGNOSTICS_ADDRESS: "localhost:8080" IPAM_INSECURE_DIAGNOSTICS: "true" -# Args to pass to the deploy.sh script when deploying Ironic and BMO +# Args to pass to the deploy-cli when deploying Ironic and BMO # [k]eepalived [t]ls [n]o basic auth or [m]ariadb BMO_IRONIC_ARGS: "-k {{ (IRONIC_TLS_SETUP == 'true') | ternary('-t', '') }} {{ (IRONIC_BASIC_AUTH == 'true') | ternary('', '-n') }} {{ (IRONIC_USE_MARIADB == 'true') | ternary('-m', '') }}"