removed asset recompilation when relative_url is used

Since 8.3.0 static assets are handled by gitlab-workhorse. We no longer
need to recompile the assets to handle issues such as #481 #521 #581 and
the like
This commit is contained in:
Sameer Naik 2015-12-20 13:43:51 +05:30
parent 607928ffcc
commit b532eb9fca

View File

@ -879,18 +879,6 @@ initialize_datadir() {
chmod 700 ${GITLAB_DATA_DIR}/.ssh
chmod 600 ${GITLAB_DATA_DIR}/.ssh/authorized_keys
chown -R ${GITLAB_USER}:${GITLAB_USER} ${GITLAB_DATA_DIR}/.ssh
# if relative_url is used the assets are compiled at runtime and placed in the
# data volume for persistence. We set up symbolic links here to achieve this.
if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
# symlink ${GITLAB_INSTALL_DIR}/tmp/cache -> ${GITLAB_DATA_DIR}/tmp/cache
rm -rf ${GITLAB_INSTALL_DIR}/tmp/cache
exec_as_git ln -s ${GITLAB_DATA_DIR}/tmp/cache ${GITLAB_INSTALL_DIR}/tmp/cache
# symlink ${GITLAB_INSTALL_DIR}/public/assets -> ${GITLAB_DATA_DIR}/tmp/public/assets
rm -rf ${GITLAB_INSTALL_DIR}/public/assets
exec_as_git ln -s ${GITLAB_DATA_DIR}/tmp/public/assets ${GITLAB_INSTALL_DIR}/public/assets
fi
}
sanitize_datadir() {
@ -1079,25 +1067,7 @@ migrate_database() {
if [[ ${GITLAB_VERSION} != ${CACHE_VERSION} || ${GITLAB_RELATIVE_URL_ROOT} != ${CACHE_GITLAB_RELATIVE_URL_ROOT} ]]; then
echo "Migrating database..."
exec_as_git bundle exec rake db:migrate >/dev/null
# recreate the tmp directory
rm -rf ${GITLAB_DATA_DIR}/tmp
exec_as_git mkdir -p ${GITLAB_DATA_DIR}/tmp/
# assets need to be recompiled when GITLAB_RELATIVE_URL_ROOT is used
if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
# create the tmp/cache and tmp/public/assets directory
exec_as_git mkdir -p ${GITLAB_DATA_DIR}/tmp/cache/
exec_as_git mkdir -p ${GITLAB_DATA_DIR}/tmp/public/assets/
echo "Recompiling assets (relative_url in use), this could take a while..."
exec_as_git bundle exec rake assets:clean assets:precompile cache:clear >/dev/null 2>&1
else
# clear the cache
exec_as_git bundle exec rake cache:clear >/dev/null 2>&1
fi
# update VERSION information
exec_as_git bundle exec rake cache:clear >/dev/null 2>&1
exec_as_git echo "${GITLAB_VERSION}" > ${GITLAB_DATA_DIR}/tmp/VERSION
exec_as_git echo "${GITLAB_RELATIVE_URL_ROOT}" > ${GITLAB_DATA_DIR}/tmp/GITLAB_RELATIVE_URL_ROOT
fi