From 4a21794c047cae8b671cb01be60f9a44f7bcaaf2 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 27 Sep 2022 17:06:21 +0200 Subject: [PATCH] [skip-ci] Update docker file --- infrastructure/c4k-website-build/image/Dockerfile | 6 ++++-- .../c4k-website-build/image/resources/functions.sh | 2 +- .../c4k-website-build/image/resources/install.sh | 11 ++++++++--- .../c4k-website-build/image/resources/project.clj | 13 +++++++++++-- src/main/cljs/dda/c4k_website/browser.cljs | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/infrastructure/c4k-website-build/image/Dockerfile b/infrastructure/c4k-website-build/image/Dockerfile index 9236670..f922c8f 100644 --- a/infrastructure/c4k-website-build/image/Dockerfile +++ b/infrastructure/c4k-website-build/image/Dockerfile @@ -1,4 +1,4 @@ -FROM clojure:temurin-18-jammy +FROM clojure:lein # Prepare Entrypoint Script ADD resources /tmp @@ -7,4 +7,6 @@ ENV BUILDDIR="website" ENV WEBSITEROOT="/var/www/html/website/" RUN /tmp/install.sh -RUN /tmp/entrypoint.sh +#RUN /tmp/entrypoint.sh + +# ToDo: lein not working on clojure image? \ No newline at end of file diff --git a/infrastructure/c4k-website-build/image/resources/functions.sh b/infrastructure/c4k-website-build/image/resources/functions.sh index 37102f0..fbc6773 100644 --- a/infrastructure/c4k-website-build/image/resources/functions.sh +++ b/infrastructure/c4k-website-build/image/resources/functions.sh @@ -13,5 +13,5 @@ function build-and-extract-website() { # set variables from environment # read write zugriff sicherstellen function move-website-files-to-target() { - rsync -ru --exclude-from "/home/$USER/exclude.pattern" --delete WEB-INF/classes/public/* $TARGETDIR + rsync -ru --exclude-from "/etc/exclude.pattern" --delete WEB-INF/classes/public/* $TARGETDIR } diff --git a/infrastructure/c4k-website-build/image/resources/install.sh b/infrastructure/c4k-website-build/image/resources/install.sh index 5ad0b59..9137061 100755 --- a/infrastructure/c4k-website-build/image/resources/install.sh +++ b/infrastructure/c4k-website-build/image/resources/install.sh @@ -2,8 +2,13 @@ apt update > /dev/null; +apt install -y unzip rsync + +mkdir /etc/lein/ + install -m 0700 /tmp/entrypoint.sh / install -m 0700 /tmp/functions.sh /usr/local/bin/ -install -m 0700 /tmp/exclude.pattern /home/$USER -install -m 0700 /tmp/project.clj /home/$USER/.lein/ -(cd /home/$USER/.lein; lein deps) +install -m 0700 /tmp/exclude.pattern /etc/ +install -m 0700 /tmp/project.clj /etc/lein/ +cd /etc/lein; +lein deps; diff --git a/infrastructure/c4k-website-build/image/resources/project.clj b/infrastructure/c4k-website-build/image/resources/project.clj index 8f5e9a0..403046f 100644 --- a/infrastructure/c4k-website-build/image/resources/project.clj +++ b/infrastructure/c4k-website-build/image/resources/project.clj @@ -1,2 +1,11 @@ -{:user - {:plugins [[lein-ring "0.12.5"]]}} \ No newline at end of file +(defproject org.domaindrivenarchitecture/c4k-website-build "0.1.1-SNAPSHOT" + :description "website c4k-build package" + :url "https://domaindrivenarchitecture.org" + :license {:name "Apache License, Version 2.0" + :url "https://www.apache.org/licenses/LICENSE-2.0.html"} + :dependencies [[org.clojure/clojure "1.9.0"] + [dda/cryogen-bootstrap "0.1.5"]] + :plugins [[lein-ring "0.12.5"]] + :main cryogen.core + :ring {:init cryogen.server/init + :handler cryogen.server/handler}) diff --git a/src/main/cljs/dda/c4k_website/browser.cljs b/src/main/cljs/dda/c4k_website/browser.cljs index 90c2aa8..0db87dc 100644 --- a/src/main/cljs/dda/c4k_website/browser.cljs +++ b/src/main/cljs/dda/c4k_website/browser.cljs @@ -57,7 +57,7 @@ {:issuer issuer}) ))) -(defn validate-all! [] +(defn validate-all! [] ; ToDo: Add all necessary inputs and auth (br/validate! "fqdn" ::website/fqdn) (br/validate! "issuer" ::website/issuer :optional true) (br/validate! "volume-total-storage-size" ::website/volume-total-storage-size :deserializer js/parseInt)