From 231aae2ed2ea5875fbd90a19b171a0b595dcc6c2 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sat, 21 Dec 2013 15:32:39 +0530 Subject: [PATCH] gitlab: moved backups directory to /home/git/data/backups --- README.md | 6 ++---- resources/gitlab | 7 ++++--- resources/setup/install | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 06c9a949..c1ce2536 100644 --- a/README.md +++ b/README.md @@ -170,12 +170,10 @@ Before taking a backup, please make sure that the gitlab image is not running fo docker stop ``` -For backups we mount a volume at /home/git/gitlab/tmp/backups so the backups are saved securely. With the volume mounted, all that you need to do is pass the "app:backup" command to the container image. +To take a backup all you need to do is pass the "app:backup" command to the container image. ```bash -mkdir -p /opt/gitlab/backups -docker run -i -t -h git.local.host \ - -v /opt/gitlab/backups:/home/git/gitlab/tmp/backups \ + docker run -i -t -h git.local.host \ -v /opt/gitlab/data:/home/git/data \ -v /opt/gitlab/.ssh:/home/git/.ssh \ sameersbn/gitlab app:backup diff --git a/resources/gitlab b/resources/gitlab index cd0fcdac..73724e7e 100755 --- a/resources/gitlab +++ b/resources/gitlab @@ -166,15 +166,16 @@ sudo chmod ug-s /home/git/data/gitlab-satellites/ find /home/git/data/gitlab-satellites/ -type d -print0 | sudo xargs -0 chmod g+s chown git:git /home/git/data/gitlab-satellites +# create the backups directory +sudo -u git -H mkdir -p /home/git/data/backups/ +chown git:git /home/git/data/backups/ + # make sure /home/git/.ssh/ has the right permissions in case it is mounted as a volume. touch /home/git/.ssh/authorized_keys chmod 700 /home/git/.ssh chmod 600 /home/git/.ssh/authorized_keys chown -R git:git /home/git/.ssh -# make sure /home/git/gitlab/tmp/backups has the right permissions in case it is mounted as a volume. -chown git:git /home/git/gitlab/tmp/backups - cd /home/git/gitlab/ db_initialize () { diff --git a/resources/setup/install b/resources/setup/install index e126692a..48a5f8f8 100755 --- a/resources/setup/install +++ b/resources/setup/install @@ -44,8 +44,8 @@ chmod -R u+rwX log tmp sudo -u git -H mkdir -p public/uploads chmod -R u+rwX public/uploads -# create backups directory -sudo -u git -H mkdir -p tmp/backups +# create symlink to backups directory +sudo -u git -H ln -s /home/git/data/backups tmp/backups # create production log sudo -u git -H touch log/production.log