chore(build): set node_env to testing (#5410)

pull/5411/head
Chaim Lev-Ari 3 years ago committed by GitHub
parent 0cb5656db6
commit 7fb2e44146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,8 +13,7 @@ angular.module('portainer').config([
function ($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) { function ($urlRouterProvider, $httpProvider, localStorageServiceProvider, jwtOptionsProvider, $uibTooltipProvider, $compileProvider, cfpLoadingBarProvider) {
'use strict'; 'use strict';
var environment = '@@ENVIRONMENT'; if (process.env.NODE_ENV === 'testing') {
if (environment === 'production') {
$compileProvider.debugInfoEnabled(false); $compileProvider.debugInfoEnabled(false);
} }

@ -18,7 +18,7 @@ angular.module('portainer.app').controller('InitAdminController', [
Username: 'admin', Username: 'admin',
Password: '', Password: '',
ConfirmPassword: '', ConfirmPassword: '',
enableTelemetry: true, enableTelemetry: process.env.NODE_ENV === 'production',
}; };
$scope.state = { $scope.state = {

@ -2,6 +2,7 @@ var os = require('os');
var loadGruntTasks = require('load-grunt-tasks'); var loadGruntTasks = require('load-grunt-tasks');
const webpackDevConfig = require('./webpack/webpack.develop'); const webpackDevConfig = require('./webpack/webpack.develop');
const webpackProdConfig = require('./webpack/webpack.production'); const webpackProdConfig = require('./webpack/webpack.production');
const webpackTestingConfig = require('./webpack/webpack.testing');
var arch = os.arch(); var arch = os.arch();
if (arch === 'x64') arch = 'amd64'; if (arch === 'x64') arch = 'amd64';
@ -78,7 +79,7 @@ module.exports = function (grunt) {
]); ]);
}); });
grunt.task.registerTask('devopsbuild', 'devopsbuild:<platform>:<arch>:env', function (p, a, env = 'prod') { grunt.task.registerTask('devopsbuild', 'devopsbuild:<platform>:<arch>:<env>', function (p, a, env = 'prod') {
grunt.task.run([ grunt.task.run([
'config:prod', 'config:prod',
`env:${env}`, `env:${env}`,
@ -90,7 +91,7 @@ module.exports = function (grunt) {
'shell:download_helm_binary:' + p + ':' + a, 'shell:download_helm_binary:' + p + ':' + a,
'shell:download_kompose_binary:' + p + ':' + a, 'shell:download_kompose_binary:' + p + ':' + a,
'shell:download_kubectl_binary:' + p + ':' + a, 'shell:download_kubectl_binary:' + p + ':' + a,
'webpack:prod', `webpack:${env}`,
]); ]);
}); });
}; };
@ -114,6 +115,7 @@ gruntfile_cfg.webpack = {
dev: webpackDevConfig, dev: webpackDevConfig,
devWatch: Object.assign({ watch: true }, webpackDevConfig), devWatch: Object.assign({ watch: true }, webpackDevConfig),
prod: webpackProdConfig, prod: webpackProdConfig,
testing: webpackTestingConfig,
}; };
gruntfile_cfg.config = { gruntfile_cfg.config = {

@ -0,0 +1,6 @@
const webpackMerge = require('webpack-merge');
const productionConfig = require('./webpack.production');
module.exports = webpackMerge(productionConfig, {
optimization: { nodeEnv: 'testing' },
});
Loading…
Cancel
Save