From 52d424b332d6d794e896c980e1447ace07022f9e Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Tue, 24 Jan 2023 15:03:09 +0100 Subject: [PATCH] Add conditional startDemo.sh, only initializes if var not found --- startDemo.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/startDemo.sh b/startDemo.sh index 5910145..8d0c56c 100755 --- a/startDemo.sh +++ b/startDemo.sh @@ -1,20 +1,26 @@ #!/bin/sh -mkdir ./var -cd ./var +if [ -d './var' ]; then + echo 'Directory ./var already exists! Skipping initialization.' + ./cc-backend --server --dev +else + mkdir ./var + cd ./var -wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-dev.tar.xz -tar xJf job-archive.tar.xz -rm ./job-archive.tar.xz + wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-dev.tar.xz + tar xJf job-archive-dev.tar.xz + rm ./job-archive-dev.tar.xz -touch ./job.db -cd ../web/frontend -yarn install -yarn build + touch ./job.db + cd ../web/frontend + yarn install + yarn build -cd ../.. -cp ./configs/env-template.txt .env -cp ./docs/config.json config.json -go build ./cmd/cc-backend + cd ../.. + cp ./configs/env-template.txt .env + cp ./docs/config.json config.json + go build ./cmd/cc-backend + + ./cc-backend --server --dev --init-db --add-user demo:admin:AdminDev +fi -./cc-backend --server --dev --init-db --add-user demo:admin:AdminDev \ No newline at end of file