From 1338c6f6947d45caf63422a63bd7a381b1387165 Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Fri, 31 May 2024 15:04:08 +0200 Subject: [PATCH] add .env file to frontend --- .github/workflows/publish-chart.yaml | 0 .gitignore | 3 ++- charts/scroll-stack/charts/frontends/values.yaml | 15 +++++++++++++++ .../templates/config-file-for-services.yaml | 11 +++++++++++ readme.md | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-chart.yaml diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.gitignore b/.gitignore index f91ffb6e..82315608 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .idea genesis.json config-contracts.toml -charts/scroll-stack/*.json \ No newline at end of file +charts/scroll-stack/*.json +.env.frontend \ No newline at end of file diff --git a/charts/scroll-stack/charts/frontends/values.yaml b/charts/scroll-stack/charts/frontends/values.yaml index efd503e5..0d41f0df 100644 --- a/charts/scroll-stack/charts/frontends/values.yaml +++ b/charts/scroll-stack/charts/frontends/values.yaml @@ -12,6 +12,14 @@ image: pullPolicy: Always tag: 2.2.4 +command: + [ + "/bin/bash", + "-c", + "cp /app/conf/.env.frontend /usr/share/nginx/html/.env && \ + /usr/local/bin/entrypoint.sh" + ] + service: main: enabled: true @@ -28,6 +36,13 @@ resources: memory: "500Mi" cpu: "100m" +persistence: + *app_name: + enabled: yes + type: configMap + mountPath: /app/conf/ + name: frontends-config + defaultProbes: &default_probes enabled: true custom: true diff --git a/charts/scroll-stack/templates/config-file-for-services.yaml b/charts/scroll-stack/templates/config-file-for-services.yaml index 70f64ccb..ade8b1e3 100644 --- a/charts/scroll-stack/templates/config-file-for-services.yaml +++ b/charts/scroll-stack/templates/config-file-for-services.yaml @@ -53,3 +53,14 @@ data: {{ (.Files.Glob "coordinator-config.json").AsConfig | indent 2 }} --- {{- end }} +{{- if index .Values "frontends" "enabled" }} +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "scroll-stack.labels" $ | nindent 4 }} + name: frontends-config +data: +{{ (.Files.Glob ".env.frontend").AsConfig | indent 2 }} +--- +{{- end }} \ No newline at end of file diff --git a/readme.md b/readme.md index 067c5fe8..274b8a19 100644 --- a/readme.md +++ b/readme.md @@ -17,7 +17,7 @@ Run the following script to get the dependencies of each helm charts Run this command to generate config.toml file and genesis file ```bash cd charts/scroll-stack -time docker run --rm -it -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-e2b87879 +time docker run --rm -it -v .:/contracts/volume scrolltech/scroll-stack-contracts:gen-configs-2b5b82d4 ``` ## Launch scroll-stack