Commit 8289f7ff authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab: Let's keep shared/ and builds/ under var/ , not in gitlab-work/

Even though we do not use LFS objects, builds and build artifacts,
gitlab backups corresponding directories and recreates them upon
restore.

Current state is: the directories are living under Rails root - that is
in our gitlab-work/ inside instance, and since gitlab-work is recreated
almost on every re-instantiation if we'll have some content in that
directories - it will be lost.

Don't allow even a chance for that to happen and move what is designed
to hold data to under var/ .

NOTE we create shared/lfs-objects/ and shared/artifacts/ because if we
    do not have this dirs, gitlab backup fails. Upstream code just
    assumes the directories are there.

/cc @kazuhiko, @jerome
parent 6a4e45c5
......@@ -118,6 +118,10 @@ var = ${directory:var}/gitlab
tmp = ${:var}/tmp
uploads = ${:var}/uploads
assets = ${:var}/assets
shared = ${:var}/shared
artifacts = ${:shared}/artifacts
lfs-objects = ${:shared}/lfs-objects
builds = ${:var}/builds
backup = ${directory:var}/backup
[gitlab-repo-dir]
......@@ -139,6 +143,10 @@ var = ${gitlab-dir:var}
tmp = ${gitlab-dir:tmp}
uploads = ${gitlab-dir:uploads}
assets = ${gitlab-dir:assets}
shared = ${gitlab-dir:shared}
artifacts = ${gitlab-dir:artifacts}
lfs-objects = ${gitlab-dir:lfs-objects}
builds = ${gitlab-dir:builds}
backup = ${gitlab-dir:backup}
repositories = ${gitlab-repo-xdir:repositories}
......@@ -357,14 +365,16 @@ update-command =
<= work-base
software = {{ gitlab_repository_location }}
tune-command =
# secret* config.ru tmp/ log/
# secret* config.ru tmp/ log/ shared/ builds/
rm -f .secret &&
rm -f config.ru &&
rm -rf log tmp &&
rm -rf log tmp shared builds &&
ln -sf ${secrets:secrets}/gitlab_rails_secret .secret &&
ln -sf ${config.ru:rendered} config.ru &&
ln -sf ${gitlab:log} log &&
ln -sf ${gitlab:tmp} tmp &&
ln -sf ${gitlab:shared} shared &&
ln -sf ${gitlab:builds} builds &&
# config/
cd config &&
ln -sf ${unicorn.rb:rendered} unicorn.rb &&
......
......@@ -243,11 +243,11 @@ md5sum = 2716afaa9445c0c429c6b211356ebe8f
[gitlab.yml.in]
<= download-template
md5sum = 97b7f5654bc280542ee348cb6fa60893
md5sum = cd7aaeeb1917fdedb7656943065c0a9c
[instance-gitlab.cfg.in]
<= download-file
md5sum = 937640a46b8300edbc72901053e0392b
md5sum = 33309e35eb67ea27f7c7a4a5abd459cc
[macrolib.cfg.in]
<= download-file
......
......@@ -313,7 +313,7 @@ production: &base
<% end %>
#}
{# default ($RAILS_ROOT/shared/) is just ok
{# default ($RAILS_ROOT/shared/) is ok - we symlinked it to proper place
# Shared file storage settings
shared:
path: <%= @shared_path %>
......
Markdown is supported
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