accessibility-insights-service/create-docker-image-package...

30 строки
1.0 KiB
JavaScript
Исходник Обычный вид История

spike: Enable Docker containers on Batch service (#936) * Set job manager max wall clock in sync with task run time * Delete fixed package resolution * Revert "Delete fixed package resolution" This reverts commit 7f58eef1ec3e8fd454fce256991ad4057652a99f. * Working set * Revert "Working set" This reverts commit b01a7b4656d07c8781e013c0612cd6c93a2f1db6. * create container registry and an image for the runner * fix format * license ignore * call the script * build and drop the folder * add to drops * fix path * install google chrom/ create job manager image/ use same package.json * copy image config to artifacts in yml file * Enable Docker containers on Batch service * fix local package import * format * setup env vars / arguments and runtime configs * fix creation order * Remove key vault access * Set default key vault URL template * Updates * Enable job manager image to run on VM * Set execution flag * Squashed commit of the following: commit 638fee9f38f66bb58ef6ea46935e4ac3b8024d5d Merge: 5265f5d 2ecc850 Author: Maxim Laikine <la.maks@hotmail.com> Date: Thu Jul 30 15:02:45 2020 -0700 Merge branch 'master' of github.com:microsoft/accessibility-insights-service commit 2ecc850749199dafaff26f8541153904430547bc Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Wed Jul 29 16:48:44 2020 -0700 move ip restriction step to API deployment (#947) commit eb783653e29ea70be7c4522b43de2f64d35dc33f Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Tue Jul 28 15:48:40 2020 -0700 chore: enable https only on azure functions (#944) commit 01a605179077c99e9f402572981785b413e73b8a Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Tue Jul 28 15:46:19 2020 -0700 chore: restrict azure function access to APIM IP address (#943) * add ip restrictions to web api function app * add access rule with azure cli instead of template * Set to use created job id * Fix deployment sequence * Convert batch wrapper to support container tasks * Update test * ignore docker license check * fix lint * Add other container images setup * Run without sandbox * use no-sandbox in scanner.ts * fix unit tests * follow puppeteer troubleshooting docs * Fully enable containers * Update test * fire chrome up * start docker with admin privlige * Remove code to upload bits to blob storage * Fix workdir * Update test * Create docker images in parallel * Update image run options * copy and modify existing package.json instead of maintaining two * add script to create package.json to other docker images * move create-image-package-json.js to root directory * Set run image option per task manager. Fix script to build docker package config * Enable docker clean up * Fic script to support Mac OS. Co-authored-by: Ahme Abdo Ahmed Abdo Mohamed <ahmohame@microsoft.com> Co-authored-by: Kelsey Pownell <kepownel@microsoft.com>
2020-08-10 21:41:11 +03:00
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
spike: Enable Docker containers on Batch service (#936) * Set job manager max wall clock in sync with task run time * Delete fixed package resolution * Revert "Delete fixed package resolution" This reverts commit 7f58eef1ec3e8fd454fce256991ad4057652a99f. * Working set * Revert "Working set" This reverts commit b01a7b4656d07c8781e013c0612cd6c93a2f1db6. * create container registry and an image for the runner * fix format * license ignore * call the script * build and drop the folder * add to drops * fix path * install google chrom/ create job manager image/ use same package.json * copy image config to artifacts in yml file * Enable Docker containers on Batch service * fix local package import * format * setup env vars / arguments and runtime configs * fix creation order * Remove key vault access * Set default key vault URL template * Updates * Enable job manager image to run on VM * Set execution flag * Squashed commit of the following: commit 638fee9f38f66bb58ef6ea46935e4ac3b8024d5d Merge: 5265f5d 2ecc850 Author: Maxim Laikine <la.maks@hotmail.com> Date: Thu Jul 30 15:02:45 2020 -0700 Merge branch 'master' of github.com:microsoft/accessibility-insights-service commit 2ecc850749199dafaff26f8541153904430547bc Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Wed Jul 29 16:48:44 2020 -0700 move ip restriction step to API deployment (#947) commit eb783653e29ea70be7c4522b43de2f64d35dc33f Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Tue Jul 28 15:48:40 2020 -0700 chore: enable https only on azure functions (#944) commit 01a605179077c99e9f402572981785b413e73b8a Author: pownkel <55459788+pownkel@users.noreply.github.com> Date: Tue Jul 28 15:46:19 2020 -0700 chore: restrict azure function access to APIM IP address (#943) * add ip restrictions to web api function app * add access rule with azure cli instead of template * Set to use created job id * Fix deployment sequence * Convert batch wrapper to support container tasks * Update test * ignore docker license check * fix lint * Add other container images setup * Run without sandbox * use no-sandbox in scanner.ts * fix unit tests * follow puppeteer troubleshooting docs * Fully enable containers * Update test * fire chrome up * start docker with admin privlige * Remove code to upload bits to blob storage * Fix workdir * Update test * Create docker images in parallel * Update image run options * copy and modify existing package.json instead of maintaining two * add script to create package.json to other docker images * move create-image-package-json.js to root directory * Set run image option per task manager. Fix script to build docker package config * Enable docker clean up * Fic script to support Mac OS. Co-authored-by: Ahme Abdo Ahmed Abdo Mohamed <ahmohame@microsoft.com> Co-authored-by: Kelsey Pownell <kepownel@microsoft.com>
2020-08-10 21:41:11 +03:00
const fs = require('fs');
const packageJson = require(process.cwd() + '/package.json');
const getWebpackConfig = require(process.cwd() + '/webpack.config');
const packageDependencies = packageJson.dependencies;
const webpackConfig = getWebpackConfig();
const webpackExternals = webpackConfig.externals ? webpackConfig.externals : [];
const imagePackageDependencies = {};
webpackExternals.forEach((packageName) => {
if (packageDependencies.hasOwnProperty(packageName)) {
imagePackageDependencies[packageName] = packageDependencies[packageName];
} else {
throw new Error(`Package '${packageName}' is not declared in package.json dependencies{} section.`);
}
});
const newPackageJson = {
...packageJson,
scripts: undefined,
dependencies: imagePackageDependencies,
devDependencies: undefined,
};
fs.writeFileSync('./dist/package.json', JSON.stringify(newPackageJson, undefined, 4));