From 4906726251ed653458a004c0925bdc26bfae31bc Mon Sep 17 00:00:00 2001 From: Rising Odegua Date: Tue, 13 Apr 2021 16:37:55 +0100 Subject: [PATCH] [Scripts][s]: Add single dataset deployment script --- scripts/single-dataset-no-commit.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/single-dataset-no-commit.sh diff --git a/scripts/single-dataset-no-commit.sh b/scripts/single-dataset-no-commit.sh new file mode 100644 index 00000000..e8074b94 --- /dev/null +++ b/scripts/single-dataset-no-commit.sh @@ -0,0 +1,27 @@ +#!/bin/bash +git checkout -b gh-pages +git rm -r --cached . +rm -rf portal +mkdir -p portal +npx create-next-app portal -e https://github.com/datopian/portal.js/tree/main/examples/dataset-frictionless +mkdir portal/public/dataset + +cp -a ./data portal/public/dataset +cp -a ./datapackage.json portal/public/dataset +cp -a ./README.md portal/public/dataset + +PORTAL_DATASET_PATH=$PWD"/portal/public/dataset" +export PORTAL_DATASET_PATH + +cd portal +assetPrefix='"/'$PORTAL_REPO_NAME'/"' +basePath='"/'$PORTAL_REPO_NAME'"' +echo 'module.exports = {assetPrefix:' ${assetPrefix}', basePath: '${basePath}' }' > next.config.js ## This ensures css and public folder works +yarn export + +cd .. +cp -R -a portal/out/ ./ +touch .nojekyll +git add $PWD'/_next' $PWD'/index.html' $PWD'/dataset' $PWD'/404.html' $PWD'/.nojekyll' $PWD'/favicon.ico' +git commit -m "Build new dataset page" +git push origin gh-pages