From 668bb401c284faba2274d64f2d33737ab64b1a1b Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Fri, 12 Jun 2020 09:35:41 +0200 Subject: [PATCH] [ci] Added build web site job. --- scripts/ci/jobs/web.yml | 20 +++++++++++++++++--- scripts/docker/Dockerfile.web | 12 ++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/ci/jobs/web.yml b/scripts/ci/jobs/web.yml index 6b6d415806b..1081c033024 100644 --- a/scripts/ci/jobs/web.yml +++ b/scripts/ci/jobs/web.yml @@ -5,11 +5,8 @@ web url checker: extends: - .defaults - .rules-master-manual - image: name: $WEB_IMAGE - entrypoint: [""] - script: - cd web - > @@ -17,3 +14,20 @@ web url checker: --white-listed-files releases/* --white-listed-urls https://jenkins.opengeosys.org/job/ufz/job/ogs-container-maker/job/master/build,http://yourproxy.example.com,https://apt.kitware.com/ubuntu/,https://github.com/YOUR-USERNAME/ogs,https://jenkins.opengeosys.org/github-webhook/,http://localhost:1313,https://github.com/ufz/ogs/pull/\$1,http://www.opengeosys.org/images/xsd/OpenGeoSysXXX.xsd,https://\`-protocol content + +build web site: + stage: build + image: $WEB_IMAGE + script: + - cd web + - yarn + - hugo + rules: + - changes: + - web/ + artifacts: + paths: + - web/public + cache: + paths: + - web/node_modules diff --git a/scripts/docker/Dockerfile.web b/scripts/docker/Dockerfile.web index ef21a4b28c8..3d2e7ddec6c 100644 --- a/scripts/docker/Dockerfile.web +++ b/scripts/docker/Dockerfile.web @@ -1,2 +1,14 @@ FROM python:3-slim RUN pip install urlchecker==0.0.20 +CMD [ "/bin/bash" ] +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + --no-install-recommends curl git gnupg2 pandoc pandoc-citeproc && \ + rm -rf /var/lib/apt/lists/* +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y yarn \ + && rm -rf /var/lib/apt/lists/* +ENV HUGO_VERSION=0.72.0 +RUN curl -fSL -O "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb" \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y /hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \ + && rm /hugo_extended_${HUGO_VERSION}_Linux-64bit.deb -- GitLab