diff --git a/app/scripts/modules/oracle/src/pipeline/stages/bake/ociBakeStage.js b/app/scripts/modules/oracle/src/pipeline/stages/bake/ociBakeStage.js index d299e1afd64..f858bc3e098 100644 --- a/app/scripts/modules/oracle/src/pipeline/stages/bake/ociBakeStage.js +++ b/app/scripts/modules/oracle/src/pipeline/stages/bake/ociBakeStage.js @@ -2,7 +2,14 @@ import { module } from 'angular'; -import { AccountService, AuthenticationService, BakeryReader, Registry, PipelineTemplates } from '@spinnaker/core'; +import { + AccountService, + AuthenticationService, + BakeryReader, + BakeExecutionLabel, + Registry, + PipelineTemplates, +} from '@spinnaker/core'; import { ORACLE_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER } from './bakeExecutionDetails.controller'; export const ORACLE_PIPELINE_STAGES_BAKE_OCIBAKESTAGE = 'spinnaker.oracle.pipeline.stage.bakeStage'; @@ -16,7 +23,7 @@ module(ORACLE_PIPELINE_STAGES_BAKE_OCIBAKESTAGE, [ORACLE_PIPELINE_STAGES_BAKE_BA description: 'Bakes an image', templateUrl: require('./bakeStage.html'), executionDetailsUrl: require('./bakeExecutionDetails.html'), - executionLabelTemplateUrl: require('core/pipeline/config/stages/bake/BakeExecutionLabel'), + executionLabelComponent: BakeExecutionLabel, supportsCustomTimeout: true, validators: [ { type: 'requiredField', fieldName: 'accountName' }, diff --git a/app/scripts/modules/oracle/webpack.config.js b/app/scripts/modules/oracle/webpack.config.js new file mode 100644 index 00000000000..c9b6a7f6e17 --- /dev/null +++ b/app/scripts/modules/oracle/webpack.config.js @@ -0,0 +1,126 @@ +'use strict'; + +const path = require('path'); +const basePath = path.join(__dirname, '..', '..', '..', '..'); +const NODE_MODULE_PATH = path.join(basePath, 'node_modules'); +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const nodeExternals = require('webpack-node-externals'); +const TerserPlugin = require('terser-webpack-plugin'); +const exclusionPattern = /(node_modules|\.\.\/deck)/; +const WEBPACK_THREADS = Math.max(require('physical-cpu-count') - 1, 1); + +const WATCH = process.env.WATCH === 'true'; +const WEBPACK_MODE = WATCH ? 'development' : 'production'; +const IS_PRODUCTION = WEBPACK_MODE === 'production'; + +module.exports = { + context: basePath, + mode: WEBPACK_MODE, + stats: 'minimal', + watch: WATCH, + entry: { + lib: path.join(__dirname, 'src', 'index.ts'), + }, + output: { + path: path.join(__dirname, 'lib'), + filename: '[name].js', + library: '@spinnaker/oracle', + libraryTarget: 'umd', + umdNamedDefine: true, + }, + devtool: 'source-map', + optimization: { + minimizer: IS_PRODUCTION + ? [ + new TerserPlugin({ + cache: true, + parallel: true, + sourceMap: true, + terserOptions: { + ecma: 6, + mangle: false, + output: { + comments: false, + }, + }, + }), + ] + : [], // disable minification in development mode + }, + resolve: { + extensions: ['.json', '.js', '.jsx', '.ts', '.tsx', '.css', '.less', '.html'], + modules: [NODE_MODULE_PATH, path.resolve('.')], + alias: { + '@spinnaker/core': path.resolve(basePath, 'app', 'scripts', 'modules', 'core', 'src'), + coreImports: path.resolve( + basePath, + 'app', + 'scripts', + 'modules', + 'core', + 'src', + 'presentation', + 'less', + 'imports', + 'commonImports.less', + ), + oracle: path.join(__dirname, 'src'), + }, + }, + module: { + rules: [ + { + test: /\.js$/, + use: [ + { loader: 'cache-loader' }, + { loader: 'thread-loader', options: { workers: WEBPACK_THREADS } }, + { loader: 'babel-loader' }, + { loader: 'envify-loader' }, + { loader: 'eslint-loader' }, + ], + exclude: exclusionPattern, + }, + { + test: /\.tsx?$/, + use: [ + { loader: 'cache-loader' }, + { loader: 'thread-loader', options: { workers: WEBPACK_THREADS } }, + { loader: 'ts-loader', options: { happyPackMode: true } }, + { loader: 'eslint-loader' }, + ], + exclude: exclusionPattern, + }, + { + test: /\.less$/, + use: [ + { loader: 'style-loader' }, + { loader: 'css-loader' }, + { loader: 'postcss-loader' }, + { loader: 'less-loader' }, + ], + }, + { + test: /\.css$/, + use: [{ loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'postcss-loader' }], + }, + { + test: /\.html$/, + exclude: exclusionPattern, + use: [ + { loader: 'ngtemplate-loader?relativeTo=' + path.resolve(__dirname) + '&prefix=ecs' }, + { loader: 'html-loader' }, + ], + }, + { + test: /\.(woff|woff2|otf|ttf|eot|png|gif|ico|svg)$/, + use: [{ loader: 'file-loader', options: { name: '[name].[hash:5].[ext]' } }], + }, + { + test: require.resolve('jquery'), + use: [{ loader: 'expose-loader?$' }, { loader: 'expose-loader?jQuery' }], + }, + ], + }, + plugins: [new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true })], + externals: ['@spinnaker/core', nodeExternals({ modulesDir: '../../../../node_modules' })], +};