Skip to content

Commit b813983

Browse files
authored
Merge pull request sameersbn#3122 from kkimurak/stop-recompile-assets-for-relative_url
Stop recompiling assets to enable relative url
2 parents ea284f1 + e910e30 commit b813983

File tree

4 files changed

+1
-33
lines changed

4 files changed

+1
-33
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ LABEL \
8484

8585
EXPOSE 22/tcp 80/tcp 443/tcp
8686

87-
VOLUME ["${GITLAB_DATA_DIR}", "${GITLAB_LOG_DIR}","${GITLAB_HOME}/gitlab/node_modules"]
87+
VOLUME ["${GITLAB_DATA_DIR}", "${GITLAB_LOG_DIR}"]
8888
WORKDIR ${GITLAB_INSTALL_DIR}
8989
ENTRYPOINT ["/sbin/entrypoint.sh"]
9090
CMD ["app:start"]
File renamed without changes.
File renamed without changes.

assets/runtime/functions

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,25 +1759,6 @@ initialize_datadir() {
17591759
chmod 700 ${GITLAB_DATA_DIR}/.ssh
17601760
chmod 600 ${GITLAB_DATA_DIR}/.ssh/authorized_keys
17611761
chown -R ${GITLAB_USER}: ${GITLAB_DATA_DIR}/.ssh
1762-
1763-
# recompile and persist assets when relative_url is in use
1764-
if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
1765-
mkdir -p ${GITLAB_TEMP_DIR}/cache
1766-
chmod 755 ${GITLAB_TEMP_DIR}/cache
1767-
chown ${GITLAB_USER}: ${GITLAB_TEMP_DIR}/cache
1768-
1769-
mkdir -p ${GITLAB_TEMP_DIR}/assets
1770-
chmod 755 ${GITLAB_TEMP_DIR}/assets
1771-
chown ${GITLAB_USER}: ${GITLAB_TEMP_DIR}/assets
1772-
1773-
# symlink ${GITLAB_INSTALL_DIR}/tmp/cache -> ${GITLAB_TEMP_DIR}/cache
1774-
rm -rf ${GITLAB_INSTALL_DIR}/tmp/cache
1775-
exec_as_git ln -s ${GITLAB_TEMP_DIR}/cache ${GITLAB_INSTALL_DIR}/tmp/cache
1776-
1777-
# symlink ${GITLAB_INSTALL_DIR}/public/assets -> ${GITLAB_TEMP_DIR}/assets
1778-
rm -rf ${GITLAB_INSTALL_DIR}/public/assets
1779-
exec_as_git ln -s ${GITLAB_TEMP_DIR}/assets ${GITLAB_INSTALL_DIR}/public/assets
1780-
fi
17811762
}
17821763

17831764
sanitize_datadir() {
@@ -2253,19 +2234,6 @@ migrate_database() {
22532234
# clear cache if relative_url has changed.
22542235
[[ -f ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT ]] && CACHE_GITLAB_RELATIVE_URL_ROOT=$(cat ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT)
22552236
if [[ ! -f ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT || ${GITLAB_RELATIVE_URL_ROOT} != ${CACHE_GITLAB_RELATIVE_URL_ROOT} ]]; then
2256-
# assets need to be recompiled when GITLAB_RELATIVE_URL_ROOT is used
2257-
if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
2258-
if [[ ! -d ${GITLAB_HOME}/gitlab/node_modules ]]; then
2259-
mkdir -p ${GITLAB_HOME}/gitlab/node_modules
2260-
chown -R ${GITLAB_USER}: ${GITLAB_HOME}/gitlab/node_modules
2261-
fi
2262-
echo "Prepare recompile assets... Installing missing node_modules for assets"
2263-
chown -R ${GITLAB_USER}: ${GITLAB_HOME}/gitlab/node_modules
2264-
exec_as_git yarn install --production --pure-lockfile
2265-
echo "Recompiling assets (relative_url in use), this could take a while..."
2266-
exec_as_git bundle exec rake gitlab:assets:compile NODE_OPTIONS="--max-old-space-size=8192" >/dev/null 2>&1
2267-
fi
2268-
22692237
echo "Clearing cache..."
22702238
exec_as_git bundle exec rake cache:clear >/dev/null 2>&1
22712239
echo "${GITLAB_RELATIVE_URL_ROOT}" > ${GITLAB_TEMP_DIR}/GITLAB_RELATIVE_URL_ROOT

0 commit comments

Comments
 (0)