Skip to content

Commit 0eeebe6

Browse files
committed
CI: integration vm include IP address in name
- remove unnecessary `export`'s - improve logging in script
1 parent 2b8d8ab commit 0eeebe6

File tree

1 file changed

+5
-11
lines changed
  • ci/tasks/setup-integration-test-vm

1 file changed

+5
-11
lines changed

ci/tasks/setup-integration-test-vm/run.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,19 @@ ROOT_DIR=$(pwd)
77
export OUTPUT_DIR=${ROOT_DIR}/output
88

99
VM_IP=$(cat nimbus-ips/name)
10-
CLONE_NAME_PREFIX="construct-${JOB_OS_NAME}-integration-ci-${OS_LINE}"
11-
CLONE_NAME_SUFFIX=$(echo "${VM_IP}" | cut -d . -f 4)
12-
CLONE_NAME=${CLONE_NAME_PREFIX}-${CLONE_NAME_SUFFIX}
13-
14-
export VM_IP
15-
export CLONE_NAME_PREFIX
16-
export CLONE_NAME_SUFFIX
17-
export CLONE_NAME
1810

11+
CLONE_NAME="stembuild-${JOB_OS_NAME}-${OS_LINE}-${VM_IP}"
1912
echo "${CLONE_NAME}" > integration-vm-name/name
20-
echo "Creating VM ${CLONE_NAME} with IP: ${VM_IP}"
2113

14+
echo "Cloning ${BASE_VM_IPATH} to ${CLONE_NAME}"
2215
govc vm.clone \
2316
-vm "${BASE_VM_IPATH}" \
2417
-ds "${CLONE_DATASTORE}" \
2518
-pool "${CLONE_RESOURCE_POOL}" \
2619
-folder "${CLONE_FOLDER}" \
2720
-on=false "${CLONE_NAME}"
2821

22+
echo "Customizing ${CLONE_NAME}"
2923
govc vm.customize \
3024
-vm.ipath "${CLONE_FOLDER}"/"${CLONE_NAME}" \
3125
-ip "${VM_IP}" \
@@ -36,7 +30,7 @@ govc vm.customize \
3630
govc vm.power -on \
3731
-vm.ipath "${CLONE_FOLDER}"/"${CLONE_NAME}"
3832

39-
echo Waiting for VM to be configured with expected IP address...
33+
echo "Waiting 10 min for ${CLONE_NAME} to be configured with ${VM_IP}"
4034
SECONDS=0
4135
FOUND_IP_ADDRESS=
4236

@@ -47,7 +41,7 @@ while [ "${VM_IP}" != "${FOUND_IP_ADDRESS}" ]; do
4741
FOUND_IP_ADDRESS=$(echo "${VM_INFO}" |
4842
jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]? |select(. == \"${VM_IP}\")")
4943

50-
echo "Current IP Addresses:"
44+
echo "Current IP Addresses:"
5145
echo "${VM_INFO}" | jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]?"
5246

5347
if [ ${SECONDS} -gt 600 ] ; then

0 commit comments

Comments
 (0)