Add build patch to prevent rake task assets:compile to remove assets dir #2884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #2866
GitLab does not launch after second run if relative url is used. This is caused by following upstream change to remove assets directory on assets compile. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103715
First contained in v15.6.0 release
Issue backtrace:
sameersbn/gitlab
create symbolic link /home/git/gitlab/public/assets/ to point /home/git/data/tmp/assets if relative url is used. This is to store assets in the docker volume to avoid unnecessary recompilations. These assets are removed and recompiled only when the gitlab version or relative url root is changed.gitlab:assets:compile
became to remove assets directory directly (byFileUtils.rm_rf()
). It does not remove compiled assets itself, but remove symlink /home/git/gitlab/public/assets . Then it compiles assets as usual. These assets will be stored in newly-created normal directory /home/git/gitlab/public/assets/So we can say that it will launch successfully the first time, but will fail the next time.
To avoid the issue, this PR add a build time patch to change the behavior of rake task
gitlab:assets:compile
to empty assets directory instead of removing itself.