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
No related merge requests found
......@@ -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