From 04f84c8bc264098e89000c886f3d12d4c84fcb7a Mon Sep 17 00:00:00 2001 From: Huy Mai Date: Tue, 13 Aug 2024 06:35:40 +0000 Subject: [PATCH] Take Deploy-cli into use to replace deploy.sh Now that we have deploy-cli in BMO main, we can start using it to replace deploy.sh in installing BMO and Ironic. Signed-off-by: Huy Mai --- 02_configure_host.sh | 13 +++++++++++++ 03_launch_mgmt_cluster.sh | 2 ++ tests/roles/run_tests/tasks/move.yml | 2 ++ tests/roles/run_tests/tasks/move_back.yml | 2 ++ 4 files changed, 19 insertions(+) diff --git a/02_configure_host.sh b/02_configure_host.sh index 64156c1bf..91aacdfbb 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}" +# We are fading away from deploy.sh, in favor of deploy-cli. In the meantime, +# as deploy-cli is not available in all BMO branches, and as deploy.sh assumes +# to be in ${BMOPATH}/tools, we compile deploy-cli and put it in deploy.sh place, +# if it's available, and use deploy.sh otherwise. + +pushd "${BMOPATH}" +if make deploy-cli; then + chmod +x tools/bin/deploy-cli + rm tools/deploy.sh + cp tools/bin/deploy-cli tools/deploy.sh +fi +popd + 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 51912ebb2..8de964a68 100755 --- a/03_launch_mgmt_cluster.sh +++ b/03_launch_mgmt_cluster.sh @@ -80,6 +80,7 @@ EOF # Deploy BMO using deploy.sh script "${BMOPATH}/tools/deploy.sh" -b "${BMO_IRONIC_ARGS[@]}" + export BMOPATH # If BMO should run locally, scale down the deployment and run BMO if [[ "${BMO_RUN_LOCAL}" = "true" ]]; then @@ -238,6 +239,7 @@ EOF else # Deploy Ironic using deploy.sh script "${BMOPATH}/tools/deploy.sh" -i "${BMO_IRONIC_ARGS[@]}" + export BMOPATH fi popd } diff --git a/tests/roles/run_tests/tasks/move.yml b/tests/roles/run_tests/tasks/move.yml index ad3d78dca..b350e3a7f 100644 --- a/tests/roles/run_tests/tasks/move.yml +++ b/tests/roles/run_tests/tasks/move.yml @@ -119,6 +119,7 @@ IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" KUBECTL_ARGS: "{{ KUBECTL_ARGS }}" + BMOPATH: "{{ BMOPATH }}" args: chdir: "{{ BMOPATH }}" @@ -129,6 +130,7 @@ 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..67b1795b7 100644 --- a/tests/roles/run_tests/tasks/move_back.yml +++ b/tests/roles/run_tests/tasks/move_back.yml @@ -15,6 +15,7 @@ environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" + BMOPATH: "{{ BMOPATH }}" args: chdir: "{{ BMOPATH }}" @@ -29,6 +30,7 @@ environment: IRONIC_HOST: "{{ IRONIC_HOST }}" IRONIC_HOST_IP: "{{ IRONIC_HOST_IP }}" + BMOPATH: "{{ BMOPATH }}" when: EPHEMERAL_CLUSTER == "minikube" args: chdir: "{{ BMOPATH }}"