blob: fd1877c0fed0193f51abbfccb4c5fe3ee46aeaf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# Get Nanoc bootstrap
FROM registry.gitlab.com/gitlab-org/gitlab-docs:bootstrap
# Make the variables of the archive Dockerfiles accessible to this build-stage
ONBUILD ARG VER
ONBUILD ARG NANOC_ENV
ONBUILD ARG CI_COMMIT_REF_NAME
ONBUILD ARG BRANCH_EE
ONBUILD ARG BRANCH_OMNIBUS
ONBUILD ARG BRANCH_RUNNER
# Build the docs from this branch
ONBUILD COPY . /source/
ONBUILD RUN NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --jobs 4
ONBUILD RUN bundle exec rake setup_git default
ONBUILD RUN bundle exec nanoc compile -VV
# Move generated HTML to /site
ONBUILD RUN mkdir /site
ONBUILD RUN mv /source/public /site/${VER}
# Remove tmp dir to save some space
ONBUILD RUN rm -rf /source/tmp
# Do some HTML post-processing on the archive
ONBUILD RUN [ -f /scripts/normalize-links.sh ] && /scripts/normalize-links.sh /site ${VER} || "/scripts/normalize-links.sh not found"
# Compress images
ONBUILD RUN [ -f /scripts/compress_images.sh ] && /scripts/compress_images.sh /site ${VER} || "/scripts/compress_images.sh not found"
# Minify assets
ONBUILD RUN [ -f /scripts/minify ] && /scripts/minify /site ${VER} || "/scripts/minify not found"
# Make an index.html and 404.html which will redirect / to /${VER}/
ONBUILD RUN echo "<html><head><title>Redirect for ${VER}</title><meta http-equiv=\"refresh\" content=\"0;url='/${VER}/'\" /></head><body><p>If you are not redirected automatically, click <a href=\"/${VER}/\">here</a>.</p></body></html>" > /site/index.html
ONBUILD RUN echo "<html><head><title>Redirect for ${VER}</title><meta http-equiv=\"refresh\" content=\"0;url='/${VER}/'\" /></head><body><p>If you are not redirected automatically, click <a href=\"/${VER}/\">here</a>.</p></body></html>" > /site/404.html
|