From 8c4bd4541c5ab6b7e22624976c7309ebba181737 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 16 Aug 2020 20:11:16 +0100 Subject: [PATCH] Added non interactive makefile option; fixed flags again fixed another problem with the -data option, and added 'make headless' for use in the dockerfile --- Dockerfile | 2 +- Makefile | 13 +++++++++++++ dockerfile-debian | 2 +- main.go | 3 ++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d37c60a..68a371c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk add --update make py3-pip curl sed npm build-base python3-dev ADD . / /opt/build/ -RUN (cd /opt/build; make all) +RUN (cd /opt/build; make headless) RUN mv /opt/build/build /opt/jfa-go diff --git a/Makefile b/Makefile index 82f43c2..4490ba5 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,18 @@ sass: echo "Compiling sass" python3 scss/compile.py +sass-headless: + echo "Getting libsass" + python3 -m pip install libsass + echo "Getting node dependencies" + python3 scss/get_node_deps.py + echo "Compiling sass" + python3 scss/compile.py -y + +mail-headless: + echo "Generating email html" + python3 mail/generate.py -y + mail: echo "Generating email html" python3 mail/generate.py @@ -28,6 +40,7 @@ copy: cp -r data build/ all: configuration sass mail compile copy +headless: configuration sass-headless mail-headless copy diff --git a/dockerfile-debian b/dockerfile-debian index b5c20fe..979705e 100644 --- a/dockerfile-debian +++ b/dockerfile-debian @@ -10,7 +10,7 @@ RUN apt install nodejs ADD . / /opt/build/ -RUN (cd /opt/build; make all) +RUN (cd /opt/build; make headless) RUN mv /opt/build/build /opt/jfa-go diff --git a/main.go b/main.go index c74bb67..3a755ae 100644 --- a/main.go +++ b/main.go @@ -114,6 +114,7 @@ func main() { flag.Parse() if app.config_path == *configPath && app.data_path != *dataPath { app.data_path = *dataPath + app.config_path = filepath.Join(app.data_path, "config.ini") } else if app.config_path != *configPath && app.data_path == *dataPath { app.config_path = *configPath } else { @@ -149,7 +150,7 @@ func main() { var nConfig *os.File nConfig, err := os.Create(app.config_path) if err != nil { - app.err.Fatalf("Couldn't open config file for writing: \"%s\"", dConfigPath) + app.err.Fatalf("Couldn't open config file for writing: \"%s\"", app.config_path) } defer nConfig.Close() _, err = io.Copy(nConfig, dConfig)