From 53f215e0cb57251fe34590ed486054125cea49dc Mon Sep 17 00:00:00 2001 From: kristof de spiegeleer Date: Thu, 26 Aug 2021 12:25:33 +0000 Subject: [PATCH] ... --- .gitpod.yml | 4 +++- build.sh | 25 +++++++++++++++++++++++++ install.sh | 19 +++++++++++++++++++ run.sh | 13 +++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100755 build.sh create mode 100755 install.sh create mode 100755 run.sh diff --git a/.gitpod.yml b/.gitpod.yml index 77d77bce3..bac6f6c65 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -9,7 +9,9 @@ tasks: publtools_check cd config publishtools install - echo ' - do "publishtools run" to run website.' + cd .. + echo ' - do "./run" to run website.' + echo ' - do "./build" to build website, see in build dir' echo ' - do "open ../workspace.code-workspace" to open all relevant dirs in your editor.' ports: - port: 9998 diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..b0261b6c8 --- /dev/null +++ b/build.sh @@ -0,0 +1,25 @@ + + +source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH + +set -e +cd /workspace/www_threefold_io + + +set +e +if [ -f vue.config.js ]; then + npm run-script build +else + gridsome build +fi + +set -e + +mkdir -p /home/gitpod/publisher/publish/ +rsync -ra --delete /workspace/www_threefold_io/dist/ /home/gitpod/publisher/publish// + +cd /workspace/www_threefold_io/dist + +#echo go to http://localhost:9999/ + #python3 -m http.server 9999 + diff --git a/install.sh b/install.sh new file mode 100755 index 000000000..a08971b2a --- /dev/null +++ b/install.sh @@ -0,0 +1,19 @@ + + +source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH + +set -e + +cd /workspace/www_threefold_io + +rm -f yarn.lock +rm -rf .cache + +if [ "true" = "true" ]; then + npm install + rsync -ra --delete node_modules/ /home/gitpod/publisher/node_modules/ +else + rsync -ra --delete /home/gitpod/publisher/node_modules/ node_modules/ + npm install +fi + diff --git a/run.sh b/run.sh new file mode 100755 index 000000000..f2f2bc758 --- /dev/null +++ b/run.sh @@ -0,0 +1,13 @@ + + +source /home/gitpod/publisher/nvm.sh && nvm use --lts && export PATH=/home/gitpod/publisher/versions/node/v14.17.5/bin:$PATH + +set -e +cd /workspace/www_threefold_io + +if [ -f vue.config.js ]; then + npm run-script serve +else + gridsome develop +fi +