-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure to patch + shell scripts executed by a generic wrapper
- Loading branch information
Showing
7 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
ARG VERSION=latest | ||
FROM gitlab/gitlab-ee:$VERSION | ||
|
||
# re-set VERSION as its cleared after a FROM directive | ||
ARG VERSION | ||
COPY patches/${VERSION} /patches | ||
RUN set -e; for p in /patches/*; do patch -p0 < $p; done | ||
|
||
# copy static files | ||
COPY templates/arc.tar.gz /opt/gitlab/embedded/service/gitlab-rails/vendor/project_templates/ | ||
COPY assets/dataplant-arc.png assets/house-solid.svg /opt/gitlab/embedded/service/gitlab-rails/public/assets/ | ||
|
||
#COPY pages.projects.new.5b691961.chunk.js.gz /opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack/ | ||
#COPY pages.projects.new.5b691961.chunk.js.map.gz /opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack/ | ||
# copy and execute the patch scripts | ||
COPY scripts/${VERSION} /scripts | ||
RUN /scripts/patch.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
for patch in /scripts/patches/*.patch; do | ||
patch -p0 < "$patch" | ||
done | ||
|
||
for script in /scripts/patches/*.sh; do | ||
"$script" | ||
done |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
set -- /opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack/pages.projects.imports.new.*.chunk.js | ||
|
||
# exit if above's glob matches nothing or more than 1 file | ||
[ -e "$1" ] && [ "$#" = "1" ] | ||
|
||
# the mighty "patch" | ||
sed -Ei.bak \ | ||
's/sample:(\{text:Object\([^)]+\))/arc:\1("ProjectTemplates|ARC"),icon:".template-option .icon-gitlab_logo"},&/' \ | ||
"$1" | ||
|
||
# needs to be gzip'ed too | ||
gzip -kf "$1" | ||
|
||
# print diffs to see what was done | ||
diff -u "$1" "${1}.bak" || true |
File renamed without changes.
File renamed without changes.
File renamed without changes.