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

Improve Volume Naming in Production Script

parent 0bf01341
No related branches found
No related tags found
3 merge requests!47Integration Testing: Sequential Merge and Validation of Four Feature Branches (PR #43,#44, #45,#46),!43feat: Add new data volume for XDMod queue data,!34feat: Add new data volume for XDMod queue data
Pipeline #9069 failed with stages
in 1 minute and 7 seconds
......@@ -136,10 +136,8 @@ production-deploy:
tags: [build]
script:
- export prod_instance_id=$(openstack floating ip show $prod_floating_ip -c port_details -f value | awk -F', ' '{print $2}' | awk -F"'" '{print $2}')
- export prod_volumes=($(openstack server show $prod_instance_id -c volumes_attached -f value | awk -F"'" '{print $4}')) # Iterate over the array and perform actions for each volume
- for prod_volume in "${prod_volumes[@]}"; do
- echo "Detaching prod_volume_id=${prod_volume} from prod_instance_id=${prod_instance_id}"
- done
- export prod_volume=$(openstack server show $prod_instance_id -c volumes_attached -f value | awk -F"'" '{print $4}')
- export prod_queue_volume=$(openstack server show $prod_instance_id -c volumes_attached -f value | awk -F"'" '{print $4}' | awk 'NR==2')
- |
eval $(ssh-agent -s)
......@@ -150,8 +148,8 @@ production-deploy:
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$prod_floating_ip sudo systemctl stop mariadb
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$prod_floating_ip sudo umount /var/lib/mysql && df -h
- ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$prod_floating_ip sudo umount /data/xdmod/queues && df -h
- openstack server remove volume $prod_instance_id $prod_volumes[0]
- openstack server remove volume $prod_instance_id $prod_volumes[1]
- openstack server remove volume $prod_instance_id $prod_volume
- openstack server remove volume $prod_instance_id $prod_queue_volume
- openstack server stop $prod_instance_id
# Exporting Staging Volume IDs
......
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