Commit c27e230f authored by David Nowell's avatar David Nowell
Browse files

Scripting the Gitlab restore process

parent 71e9d0ff
#!/bin/bash
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
BAKFILE=`aws s3 ls {{ s3_bucket }} | grep gitlab_backup.tar | tail -1 | awk '{print $4}'`
aws s3 cp s3://{{ s3_bucket }}/${BAKFILE} /var/opt/gitlab/backups
chown git:git /var/opt/gitlab/backups/*.tar
KEYFILE=`aws s3 ls {{ s3_bucket }} | grep gitback-ssh-host-keys | tail -1 | awk '{print $4}'`
aws s3 cp s3://{{ s3_bucket }}/${KEYFILE} /etc/ssh/
cd /etc/ssh; tar -xf ${KEYFILE}
BAKNAME=`echo ${BAKFILE/_gitlab_backup.tar/}`
gitlab-rake gitlab:backup:restore BACKUP=${BAKNAME}
gitlab-ctl start unicorn
gitlab-ctl start sidekiq
usermod -G gitadmin git
systemctl restart sshd.service
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment