Skip to content

Commit

Permalink
Test Deploy-cli
Browse files Browse the repository at this point in the history
Signed-off-by: Huy Mai <huy.mai@est.tech>
  • Loading branch information
mquhuy committed Aug 13, 2024
1 parent 1b32846 commit 62479c0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions 02_configure_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ mkdir -p "${M3PATH}"
detect_mismatch "${BMO_LOCAL_IMAGE:-}" "${BMOPATH}"
clone_repo "${BMOREPO}" "${BMOBRANCH}" "${BMOPATH}" "${BMOCOMMIT}"

pushd "${BMOPATH}"
make deploy-cli
sudo install tools/bin/deploy-cli /usr/bin/
popd

detect_mismatch "${CAPM3_LOCAL_IMAGE:-}" "${CAPM3PATH}"
clone_repo "${CAPM3REPO}" "${CAPM3BRANCH}" "${CAPM3PATH}" "${CAPM3COMMIT}"

Expand Down
5 changes: 3 additions & 2 deletions 03_launch_mgmt_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ EOF
echo "DEPLOY_ISO_URL=${DEPLOY_ISO_URL}" | sudo tee -a "${BMOPATH}/config/default/ironic.env"
fi

cp "${BMOPATH}/config/default/ironic.env" "${IRONIC_DATA_DIR}/ironic.env"
# Deploy BMO using deploy.sh script
"${BMOPATH}/tools/deploy.sh" -b "${BMO_IRONIC_ARGS[@]}"
deploy-cli -b "${BMO_IRONIC_ARGS[@]}"

# If BMO should run locally, scale down the deployment and run BMO
if [ "${BMO_RUN_LOCAL}" == "true" ]; then
Expand Down Expand Up @@ -214,7 +215,7 @@ EOF
${RUN_LOCAL_IRONIC_SCRIPT}
else
# Deploy Ironic using deploy.sh script
"${BMOPATH}/tools/deploy.sh" -i "${BMO_IRONIC_ARGS[@]}"
deploy-cli -i "${BMO_IRONIC_ARGS[@]}"
fi
popd
}
Expand Down
4 changes: 2 additions & 2 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export FORCE_REPO_UPDATE="${FORCE_REPO_UPDATE:-true}"

export M3PATH="${M3PATH:-${GOPATH}/src/github.com/metal3-io}"
export BMOPATH="${BMOPATH:-${M3PATH}/baremetal-operator}"
export BMOREPO="${BMOREPO:-https://github.com/metal3-io/baremetal-operator.git}"
export BMOREPO="${BMOREPO:-https://github.com/Nordix/baremetal-operator.git}"
export BMO_BASE_URL="${BMO_BASE_URL:-metal3-io/baremetal-operator}"

export RUN_LOCAL_IRONIC_SCRIPT="${BMOPATH}/tools/run_local_ironic.sh"
Expand Down Expand Up @@ -292,7 +292,7 @@ elif [[ "${CAPM3RELEASEBRANCH}" = "release-1.7" ]]; then
else
export CAPM3_IMAGE="${CAPM3_IMAGE:-${CONTAINER_REGISTRY}/metal3-io/cluster-api-provider-metal3:main}"
export IPAM_IMAGE="${IPAM_IMAGE:-${CONTAINER_REGISTRY}/metal3-io/ip-address-manager:main}"
export BMOBRANCH="${BMORELEASEBRANCH:-main}"
export BMOBRANCH="mquhuy/deploy-cli"
fi

# IPXE support image
Expand Down
5 changes: 3 additions & 2 deletions tests/roles/run_tests/tasks/move.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@

# Install BMO
- name: Install Baremetal Operator
shell: "{{ BMOPATH }}/tools/deploy.sh -b {{ BMO_IRONIC_ARGS }}"
# 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 }}"
Expand All @@ -124,7 +125,7 @@

# 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 }}"
Expand Down
6 changes: 4 additions & 2 deletions tests/roles/run_tests/tasks/move_back.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand All @@ -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 }}"
Expand Down

0 comments on commit 62479c0

Please sign in to comment.