Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Dockerfile.builder.onbuild « dockerfiles - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f768892b4286e939a15b4beb6e47c620f87239d7 (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
# Get Nanoc bootstrap
FROM registry.gitlab.com/gitlab-com/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_CE
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 /scripts/normalize-links.sh /site ${VER}

# 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