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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-12-09 11:59:50 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2019-12-09 11:59:50 +0300
commit4defe41d28695c38816e12ed4680d6a60c21e134 (patch)
tree85de5e81dae1d4aed94339d216ab686d53d8beb3 /dockerfiles
parent341b92f23b2a9ef6d1f87846be5ff6bfead2513f (diff)
Check the existence of the scripts before running them
Since all Docker builds share the same image and we add new scripts as we go along, we need a way to check if the scripts do really exist. Older branches will not have them and will break otherwise.
Diffstat (limited to 'dockerfiles')
-rw-r--r--dockerfiles/Dockerfile.builder.onbuild6
1 files changed, 3 insertions, 3 deletions
diff --git a/dockerfiles/Dockerfile.builder.onbuild b/dockerfiles/Dockerfile.builder.onbuild
index 6f72cc53..8abbf5a6 100644
--- a/dockerfiles/Dockerfile.builder.onbuild
+++ b/dockerfiles/Dockerfile.builder.onbuild
@@ -23,13 +23,13 @@ ONBUILD RUN mv /source/public /site/${VER}
ONBUILD RUN rm -rf /source/tmp
# Do some HTML post-processing on the archive
-ONBUILD RUN /scripts/normalize-links.sh /site ${VER}
+ONBUILD RUN [ -f /scripts/normalize-links.sh ] && /scripts/normalize-links.sh /site ${VER} || "/scripts/normalize-links.sh not found"
# Compress images
-ONBUILD RUN /scripts/compress_images.sh /site ${VER}
+ONBUILD RUN [ -f /scripts/compress_images.sh ] && /scripts/compress_images.sh /site ${VER} || "/scripts/compress_images.sh not found"
# Minify assets
-ONBUILD RUN /scripts/minify ${VER}
+ONBUILD RUN [ -f /scripts/minify ] && /scripts/minify ${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