Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
Terraform Openstack
Commits
c6ab219d
Commit
c6ab219d
authored
1 year ago
by
Eesaan Atluri
Browse files
Options
Downloads
Patches
Plain Diff
Reattach the prod volume to prod instance for rollback
parent
1654473a
No related branches found
No related tags found
1 merge request
!35
Update prod pipeline
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+4
-4
4 additions, 4 deletions
.gitlab-ci.yml
with
4 additions
and
4 deletions
.gitlab-ci.yml
+
4
−
4
View file @
c6ab219d
...
...
@@ -132,7 +132,6 @@ production-deploy:
ssh-add "${SSH_PRIV_KEY}"
mkdir ~/.ssh
chmod 700 ~/.ssh
-
export instance_volume=$(openstack server show $instance_id -c volumes_attached -f value | awk -F"'" '{print $4}')
-
echo "Detaching instance_volume_id=${instance_volume} from new instance=${instance_id}"
-
ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$instance_floating_ip sudo systemctl stop mariadb
...
...
@@ -147,9 +146,10 @@ production-deploy:
-
openstack server remove volume $prod_instance_id $prod_volume
-
openstack volume snapshot create --volume $prod_volume xdmod-prod-data-vol-snapshot-$BUILD_DATE
-
echo "Attach copy of prod volume $xdmod-prod-vol-$BUILD_DATE to newly deployed instance $instance_id"
-
openstack volume create --snapshot xdmod-prod-data-vol-snapshot-$BUILD_DATE --size 150 xdmod-prod-vol-$BUILD_DATE
-
openstack server add volume $instance_id xdmod-prod-vol-$BUILD_DATE --device /dev/vdb
-
echo "Reattach the prod_volume=${prod_volume} to prod_instance_id=${prod_instance_id} after snapshot is created"
-
openstack server add volume $prod_instance_id $prod_volume --device /dev/vdb
-
ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$prod_floating_ip sudo mount /dev/vdb1 /var/lib/mysql && df -h
-
ssh -o StrictHostKeyChecking=no $SSH_USERNAME@$prod_floating_ip sudo systemctl start mariadb
-
echo "swap the floating IP between prod and newly deployed instances"
-
openstack server remove floating ip $prod_instance_id $prod_floating_ip
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment