diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-03-16 16:07:27 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-03-16 16:07:27 +0000 |
commit | 24673741fb1ad30c273e89c25d366e0136dfaa5b (patch) | |
tree | 0a30c7c393508b1d1d9f60defb1e3021d0b6dcd7 /gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh | |
parent | 3615cc776d0a926fc45ce280cfc6ee679d01366e (diff) | |
download | definitions-24673741fb1ad30c273e89c25d366e0136dfaa5b.tar.gz |
Remove Gitlab systems
As far as I know, these are out of date, unmaintained and nobody is
using them. It was definitely a useful learning process to integrate
Gitlab into Baserock, but I think this is now just taking up space in
definitions.git needlessly.
Change-Id: Ifdd9c0a3dd889382bc5e6825c2df4f3afbd89f3c
Diffstat (limited to 'gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh')
-rw-r--r-- | gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh b/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh deleted file mode 100644 index 78ff691a..00000000 --- a/gitlab-server/usr/share/gitlab-install/gitlab-remote-restore.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# Restore a Baserock Gitlab system backup to a fresh instance. -# -# Usage: restore.sh ADDR -# where ADDR is the address (domain name, IP address) of the instance. -# -# What this does is a) stop services b) copy files over c) reset the Postgres -# databases. - -set -eux - -ADDR="$1" - -restore() -{ - rsync -ahHS --delete "$2" "root@$ADDR:$1" -} - -# Stop services so we don't modify files and databases from underneath -# them, and also so they don't modify things while restore is happening. - -ssh "root@$ADDR" systemctl stop \ - crond gitlab-backup.service \ - gitlab-ci-sidekiq.service \ - gitlab-ci-unicorn.service \ - gitlab-sidekiq.service \ - gitlab-unicorn.service \ - gitlab.target \ - gitlab-backup.timer \ - nginx.service \ - redis.service - -# Create the directory where postgres dump files go. - -ssh "root@$ADDR" install -d -o postgres -g postgres /home/postgres/dumps - -# Restore the various files. - -restore /home/postgres/dumps/. dumps/. -restore /home/git/repositories/. repositories/. -restore /home/git/gitlab/public/uploads/. uploads/. - -# And thier uid/gid -ssh "root@$ADDR" chown -R git:git /home/git/repositories /home/git/gitlab/public/uploads - -# Delete tables and roles from Postgres so that the restore can happen. - -ssh "root@$ADDR" sudo -u postgres psql <<EOF -drop database gitlabhq_production; -drop database gitlab_ci_production; -drop role git, gitlab_ci; -EOF - -# Restore the Postgres databases from the latest dump. - -ssh "root@$ADDR" sudo -u postgres psql -q -f /home/postgres/dumps/gitlab.pg_dumpall |