Skip to content
Snippets Groups Projects
Commit 5f5129e0 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

capture PROXY_INSTANCE_ID directly from server creation output

- Updated deploy_ood_proxy_node script to retrieve PROXY_INSTANCE_ID directly using `openstack server create` with `--format value --column id`
- Added debug logging to output the created instance ID
- Simplified instance creation and floating IP assignment process
parent 97ad1d92
No related branches found
No related tags found
1 merge request!2Add OOD proxy node deployment to CI/CD pipeline
Pipeline #11482 failed
......@@ -42,7 +42,7 @@ workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'schedule'
deploy_ood_proxy_node:
stage: deploy
environment:
......@@ -51,13 +51,22 @@ deploy_ood_proxy_node:
- build
script:
- |
openstack server create \
PROXY_INSTANCE_ID=$(openstack server create \
--image $PKR_VAR_source_image \
--flavor $PKR_VAR_flavor \
--network $OOD_INSTANCE_NETWORK \
--wait \
$OOD_PROXY_NAME
- PROXY_INSTANCE_ID=$(openstack server show -f value -c id $OOD_PROXY_NAME)
- openstack server add floating ip $OOD_PROXY_NAME $PROXY_IP
- echo "PROXY_INSTANCE_ID=$PROXY_INSTANCE_ID" >> $CI_PROJECT_DIR/variables.env
\ No newline at end of file
--format value \
--column id \
$OOD_PROXY_NAME)
# Log the created instance ID for debugging
echo "Created PROXY_INSTANCE_ID: $PROXY_INSTANCE_ID"
# Add a floating IP to the created server
openstack server add floating ip $OOD_PROXY_NAME $PROXY_IP
# Store the instance ID in variables.env for later use
echo "PROXY_INSTANCE_ID=$PROXY_INSTANCE_ID" >> $CI_PROJECT_DIR/variables.env
rules:
when: manual
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment