From ec4e2ef1a6e3bc2a1b4926129f92f55ca54be0fc Mon Sep 17 00:00:00 2001 From: Danny Brown Date: Tue, 27 Aug 2019 15:19:23 -0400 Subject: [PATCH] ci: fix dev-server script (#811) * ci: test docs-publish * Require unit tests for dry run * ci: Make sure our docs publish is executable * Try to correct path issue * Try repo prefix * Try as yarn command * Need a workspace to attach to from previous step * Add before we call our bash script * See if we can enforce commands being available -- or just install locally? * Try again * Try SSH * Include username in gh https url * Note regarding failure on PR branches * Remove docs publish from PR workflow * chore: ability to specify an alternative html-template at build time * chore: add command to build demo PWA website output * chore: remove unused CI code * Testing GCP capabilities * syntax * Naming * naming * chore: WebPack output progress that we care about * chore: Only publish the app config we care about * PWA should publish source map * Unused index.html file * chore: Remove unused copy-webpack-plugin ignore * Don't generate source map until we resolve memory issue * ci: attempt to publish with GCP bucket deploy * Update dev config to use new template loccations and env vars --- platform/viewer/.webpack/all.dev.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/viewer/.webpack/all.dev.js b/platform/viewer/.webpack/all.dev.js index f7e68bbe2..776cfe35a 100644 --- a/platform/viewer/.webpack/all.dev.js +++ b/platform/viewer/.webpack/all.dev.js @@ -19,6 +19,7 @@ const DIST_DIR = path.join(__dirname, '../dist'); const PUBLIC_DIR = path.join(__dirname, '../public'); const ASSET_PATH = process.env.ASSET_PATH || '/'; // Env Vars +const HTML_TEMPLATE = process.env.HTML_TEMPLATE || 'index.html'; const PUBLIC_URL = process.env.PUBLIC_URL || ''; const APP_CONFIG = process.env.APP_CONFIG || 'config/default.js'; @@ -42,16 +43,21 @@ module.exports = (env, argv) => { to: DIST_DIR, toType: 'dir', // Ignore our HtmlWebpackPlugin template file - ignore: ['index.html', '.DS_Store'], + // Ignore our configuration files + ignore: ['config/*', 'html-templates/*', '.DS_Store'], + }, + // Copy over and rename our target app config file + { + from: `${PUBLIC_DIR}/${APP_CONFIG}`, + to: `${DIST_DIR}/app-config.js`, }, ]), // Generate "index.html" w/ correct includes/imports new HtmlWebpackPlugin({ - template: `${PUBLIC_DIR}/index.html`, + template: `${PUBLIC_DIR}/html-templates/${HTML_TEMPLATE}`, filename: 'index.html', templateParameters: { PUBLIC_URL: PUBLIC_URL, - APP_CONFIG: APP_CONFIG, }, }), ],