From aca17e4d385a99f423410ef06c05be9666ef050a Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Mon, 23 Jul 2018 10:19:52 +0200 Subject: [PATCH] feat(netlify) Add static site deployment from Netlify (add /viewer to the deploy preview URL) (#232) --- docs/README.md | 2 ++ docs/package.json | 3 +++ generateStaticSite.sh | 24 ++++++++++++++++++++++++ package.json | 3 ++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 generateStaticSite.sh diff --git a/docs/README.md b/docs/README.md index 68a425db9..e5ba8e9aa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,5 @@ +##### Looking for your Deploy Preview? - Deploy Preview for Viewer + # Introduction The [Open Health Imaging Foundation](https://www.ohif.org) is developing an open source framework for constructing web-based medical imaging applications. The application framework is built using modern HTML / CSS / JavaScript and uses [Cornerstone](https://cornerstonejs.org/) at its core to display and manipulate medical images. It is built with Meteor, a Node.js-based full-stack JavaScript platform. diff --git a/docs/package.json b/docs/package.json index 5fcea3fd4..078ec0246 100644 --- a/docs/package.json +++ b/docs/package.json @@ -38,5 +38,8 @@ "gitbook-plugin-github": "^3.0.0", "gitbook-plugin-sitemap": "^1.2.0", "gitbook-plugin-theme-cornerstone": "^1.1.1" + }, + "devDependencies": { + "gitbook-cli": "^2.3.2" } } diff --git a/generateStaticSite.sh b/generateStaticSite.sh new file mode 100755 index 000000000..0f2750971 --- /dev/null +++ b/generateStaticSite.sh @@ -0,0 +1,24 @@ +cd docs +npm -v +node -v +echo 'Installing Gitbook CLI' +npm install + +echo 'Running Gitbook installation' +./node_modules/gitbook-cli/bin/gitbook.js install +./node_modules/gitbook-cli/bin/gitbook.js build +cd .. + +# Build and copy the StandaloneViewer into the static directory +cd StandaloneViewer +echo $DEPLOY_PRIME_URL +export ROOT_URL=$DEPLOY_PRIME_URL:/viewer/ +export METEOR_PACKAGE_DIRS="../../Packages" +mkdir buildDirectory +cd StandaloneViewer +npm install -g meteor-build-client-fixed@0.4.3 +meteor-build-client-fixed --version +curl https://install.meteor.com | /bin/sh +export PATH=$HOME/.meteor:$PATH +meteor npm install +meteor-build-client-fixed ../../docs/_book/viewer -u $ROOT_URL --path './' \ No newline at end of file diff --git a/package.json b/package.json index da3e1b12c..96724d992 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "dependencies": {}, "devDependencies": {}, "scripts": { - "test": "./test/testApp.sh" + "test": "./test/testApp.sh", + "staticDeploy": "./generateStaticSite.sh" }, "repository": { "type": "git",