@eui/tools 4.18.9 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.version.properties +1 -1
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/scripts/csdr/config/angular.js +117 -1
- package/scripts/csdr/install/remote.js +3 -3
- package/scripts/csdr/metadata/package.js +25 -2
- package/scripts/csdr/release/app/release-app.js +5 -2
- package/scripts/csdr/release/package/common.js +13 -4
- package/scripts/csdr/release/package/release-package.js +3 -3
- package/scripts/csdr/version/package.js +13 -9
- package/scripts/utils/build/app/build-app-utils.js +9 -8
- package/scripts/utils/git-utils.js +42 -0
- package/scripts/utils/pre-build/projects.js +4 -4
- package/scripts/utils/serve/app.js +2 -2
- package/scripts/utils/tools.js +0 -2
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.19.0
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 4.19.0 (2022-01-21)
|
|
2
|
+
|
|
3
|
+
##### New Features
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* enabled hotfix branching - added configEnvTarget as pipeline parameter - enhance support/develop flow - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([69d420ed](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/69d420ed77ecd8947ad4801ce2da1ce9e23c1c50))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
1
10
|
## 4.18.9 (2022-01-17)
|
|
2
11
|
|
|
3
12
|
##### Chores
|
package/package.json
CHANGED
|
@@ -224,6 +224,118 @@ const angularProjectDef = {
|
|
|
224
224
|
};
|
|
225
225
|
|
|
226
226
|
|
|
227
|
+
|
|
228
|
+
const angularProjectLightDef = {
|
|
229
|
+
"root": "",
|
|
230
|
+
"sourceRoot": "apps/@project.name@/src",
|
|
231
|
+
"projectType": "application",
|
|
232
|
+
"prefix": "app",
|
|
233
|
+
"schematics": {
|
|
234
|
+
"@schematics/angular:component": {
|
|
235
|
+
"styleext": "scss"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"architect": {
|
|
239
|
+
"build": {
|
|
240
|
+
"builder": "ngx-build-plus:build",
|
|
241
|
+
"options": {
|
|
242
|
+
"outputPath": "apps/@project.name@/dist",
|
|
243
|
+
"index": "apps/@project.name@/src/index.html",
|
|
244
|
+
"main": "apps/@project.name@/src/main.ts",
|
|
245
|
+
"polyfills": "apps/@project.name@/src/polyfills.ts",
|
|
246
|
+
"tsConfig": "apps/@project.name@/tsconfig.app.json",
|
|
247
|
+
"assets": [
|
|
248
|
+
"apps/@project.name@/src/favicon.ico",
|
|
249
|
+
"apps/@project.name@/src/assets",
|
|
250
|
+
{
|
|
251
|
+
"glob": "**/*",
|
|
252
|
+
"input": "node_modules/@eui/core/assets/",
|
|
253
|
+
"output": "./assets"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"styles": [
|
|
257
|
+
"node_modules/@eui/styles/dist/assets/fonts/webfont/Roboto/Roboto.css",
|
|
258
|
+
"node_modules/@eui/styles/dist/styles/eui-primeng.css",
|
|
259
|
+
"node_modules/@eui/styles/dist/styles/eui.css",
|
|
260
|
+
"node_modules/@eui/styles/dist/styles/eui-shell-extended.css",
|
|
261
|
+
"apps/@project.name@/src/styles.scss"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"configurations": {
|
|
265
|
+
"production": {
|
|
266
|
+
"fileReplacements": [
|
|
267
|
+
{
|
|
268
|
+
"replace": "apps/@project.name@/src/environments/environment.ts",
|
|
269
|
+
"with": "apps/@project.name@/src/environments/environment.prod.ts"
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
"optimization": false,
|
|
273
|
+
"outputHashing": "all",
|
|
274
|
+
"sourceMap": false,
|
|
275
|
+
"extractCss": true,
|
|
276
|
+
"namedChunks": true,
|
|
277
|
+
"aot": true,
|
|
278
|
+
"extractLicenses": true,
|
|
279
|
+
"vendorChunk": false,
|
|
280
|
+
"buildOptimizer": false,
|
|
281
|
+
"budgets": [
|
|
282
|
+
{
|
|
283
|
+
"type": "initial",
|
|
284
|
+
"maximumWarning": "2mb",
|
|
285
|
+
"maximumError": "7mb"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"production-optimized": {
|
|
290
|
+
"fileReplacements": [
|
|
291
|
+
{
|
|
292
|
+
"replace": "apps/@project.name@/src/environments/environment.ts",
|
|
293
|
+
"with": "apps/@project.name@/src/environments/environment.prod.ts"
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
"optimization": true,
|
|
297
|
+
"outputHashing": "all",
|
|
298
|
+
"sourceMap": false,
|
|
299
|
+
"extractCss": true,
|
|
300
|
+
"namedChunks": true,
|
|
301
|
+
"aot": true,
|
|
302
|
+
"extractLicenses": true,
|
|
303
|
+
"vendorChunk": false,
|
|
304
|
+
"buildOptimizer": true,
|
|
305
|
+
"budgets": [
|
|
306
|
+
{
|
|
307
|
+
"type": "initial",
|
|
308
|
+
"maximumWarning": "2mb",
|
|
309
|
+
"maximumError": "7mb"
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"serve": {
|
|
316
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
317
|
+
"options": {
|
|
318
|
+
"browserTarget": "@project.name@:build"
|
|
319
|
+
},
|
|
320
|
+
"configurations": {
|
|
321
|
+
"proxy-mock": {
|
|
322
|
+
"browserTarget": "@project.name@:build",
|
|
323
|
+
"proxyConfig": "apps/@project.name@/proxy-mock.conf.json"
|
|
324
|
+
},
|
|
325
|
+
"production": {
|
|
326
|
+
"browserTarget": "@project.name@:build:production"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
227
339
|
const angularProjectDefFullSkeleton = {
|
|
228
340
|
"root": "",
|
|
229
341
|
"sourceRoot": "apps/@project.name@/src",
|
|
@@ -817,7 +929,11 @@ module.exports.registerAngularProjectDef = (project, build = false) => {
|
|
|
817
929
|
}
|
|
818
930
|
|
|
819
931
|
} else {
|
|
820
|
-
|
|
932
|
+
if (project.build && project.build.csdrFileReplacement === true) {
|
|
933
|
+
projectDef = JSON.stringify(angularProjectLightDef);
|
|
934
|
+
} else {
|
|
935
|
+
projectDef = JSON.stringify(angularProjectDef);
|
|
936
|
+
}
|
|
821
937
|
}
|
|
822
938
|
let replaceProject = tools.replaceAll(projectDef, '@project.name@', project.name);
|
|
823
939
|
replaceProject = JSON.parse(replaceProject);
|
|
@@ -152,9 +152,9 @@ const getDeps = (pkg, isMaster, envTarget = null) => {
|
|
|
152
152
|
depsComposite = tools.getJsonFileContent(depsCompositeJsonFile);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
155
|
+
// TODO - handle dependencies composite per environment => one bamboo plan for each envs to be defined
|
|
156
|
+
// if (envTarget) {
|
|
157
|
+
// }
|
|
158
158
|
|
|
159
159
|
return innerCommon.getRemappedDeps(depsMetadata, { ...depsBase, ...depsComposite});
|
|
160
160
|
})
|
|
@@ -57,7 +57,7 @@ module.exports.getPackagesDeps = (depsType) => {
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
module.exports.storeMetadata = (
|
|
60
|
-
pkg, pkgVersion, pkgMetadata, isSnapshot, isMaster, isSupportBranch, isNextBranch, isSupportSnapshotBranch,
|
|
60
|
+
pkg, pkgVersion, pkgMetadata, isSnapshot, isMaster, isSupportBranch, isNextBranch, isSupportSnapshotBranch, isHotfixBranch,
|
|
61
61
|
pkgCompositeDeps, duration,
|
|
62
62
|
) => {
|
|
63
63
|
|
|
@@ -83,6 +83,7 @@ module.exports.storeMetadata = (
|
|
|
83
83
|
var packagesPrevTag = [];
|
|
84
84
|
var packagesNextTag = [];
|
|
85
85
|
var packagesPrevSnapshotsTag = [];
|
|
86
|
+
var packagesHotfixTag = [0];
|
|
86
87
|
|
|
87
88
|
if (tools.isFileExists(metadataFile)) {
|
|
88
89
|
metadata = require(metadataFile);
|
|
@@ -91,6 +92,7 @@ module.exports.storeMetadata = (
|
|
|
91
92
|
packagesPrevTag = metadata.packagesPrevTag;
|
|
92
93
|
packagesNextTag = metadata.packagesNextTag;
|
|
93
94
|
packagesPrevSnapshotsTag = metadata.packagesPrevSnapshotsTag;
|
|
95
|
+
packagesHotfixTag = metadata.packages.packagesHotfixTag;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
const newPackage = {
|
|
@@ -209,11 +211,30 @@ module.exports.storeMetadata = (
|
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
|
|
214
|
+
if (isHotfixBranch) {
|
|
215
|
+
var pkgIdxHOTFIX;
|
|
216
|
+
if (packagesHotfixTag) {
|
|
217
|
+
pkgIdxHOTFIX = packagesHotfixTag.findIndex(item => item.name === pkg.name);
|
|
218
|
+
} else {
|
|
219
|
+
pkgIdxHOTFIX = -1;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (pkgIdxHOTFIX > -1) {
|
|
223
|
+
packagesHotfixTag[pkgIdxHOTFIX] = newPackage;
|
|
224
|
+
} else {
|
|
225
|
+
if (!packagesNextTag) {
|
|
226
|
+
packagesHotfixTag = [];
|
|
227
|
+
}
|
|
228
|
+
packagesHotfixTag.push(newPackage);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
212
232
|
metadata.packages = packages;
|
|
213
233
|
metadata.packagesLatestTag = packagesLatestTag;
|
|
214
234
|
metadata.packagesPrevTag = packagesPrevTag;
|
|
215
235
|
metadata.packagesNextTag = packagesNextTag;
|
|
216
236
|
metadata.packagesPrevSnapshotsTag = packagesPrevSnapshotsTag;
|
|
237
|
+
metadata.packagesHotfixTag = packagesHotfixTag;
|
|
217
238
|
|
|
218
239
|
if (!dryRun) {
|
|
219
240
|
tools.writeJsonFileSync(metadataFile, metadata);
|
|
@@ -381,6 +402,7 @@ module.exports.storeMetadataAssets = (pkg, pkgCompositeDeps) => {
|
|
|
381
402
|
return Promise.resolve()
|
|
382
403
|
.then(() => {
|
|
383
404
|
const pkgMetadataFile = path.join(pkg.paths.pkgBuild, 'bundles', 'package-metadata.json');
|
|
405
|
+
const pkgMetadataRootFile = path.join(pkg.paths.pkgDirectory, 'package-metadata.json');
|
|
384
406
|
|
|
385
407
|
const pkgMetadata = {
|
|
386
408
|
dependencies: pkgCompositeDeps
|
|
@@ -390,7 +412,8 @@ module.exports.storeMetadataAssets = (pkg, pkgCompositeDeps) => {
|
|
|
390
412
|
console.log(pkgMetadata);
|
|
391
413
|
|
|
392
414
|
if (!dryRun) {
|
|
393
|
-
|
|
415
|
+
tools.writeJsonFileSync(pkgMetadataFile, pkgMetadata);
|
|
416
|
+
tools.writeJsonFileSync(pkgMetadataRootFile, pkgMetadata);
|
|
394
417
|
}
|
|
395
418
|
})
|
|
396
419
|
|
|
@@ -20,7 +20,7 @@ module.exports.run = () => {
|
|
|
20
20
|
const project = configUtils.projects.getProject();
|
|
21
21
|
|
|
22
22
|
// fetching command parameters
|
|
23
|
-
var { branch, dryRun, envTarget, compositeType } = utils.tools.getArgs();
|
|
23
|
+
var { branch, dryRun, envTarget, compositeType, configEnvTarget } = utils.tools.getArgs();
|
|
24
24
|
|
|
25
25
|
// checking branch and envTarget types
|
|
26
26
|
if (branch && typeof (branch) === 'boolean') {
|
|
@@ -29,6 +29,9 @@ module.exports.run = () => {
|
|
|
29
29
|
if (envTarget && typeof (envTarget) === 'boolean') {
|
|
30
30
|
envTarget = null;
|
|
31
31
|
}
|
|
32
|
+
if (configEnvTarget && typeof (configEnvTarget) === 'boolean') {
|
|
33
|
+
configEnvTarget = null;
|
|
34
|
+
}
|
|
32
35
|
|
|
33
36
|
// globals
|
|
34
37
|
if (!branch && !envTarget) {
|
|
@@ -258,7 +261,7 @@ module.exports.run = () => {
|
|
|
258
261
|
// BUILD ANGULAR APPLICATION
|
|
259
262
|
// *****************************************************************
|
|
260
263
|
.then(() => {
|
|
261
|
-
return utils.buildApp.angular(envTarget, (isSnapshot || isSupportSnapshotBranch), newVersion);
|
|
264
|
+
return utils.buildApp.angular(envTarget, (isSnapshot || isSupportSnapshotBranch), newVersion, configEnvTarget);
|
|
262
265
|
})
|
|
263
266
|
|
|
264
267
|
|
|
@@ -21,7 +21,8 @@ module.exports.getBranches = () => {
|
|
|
21
21
|
const isMaster = (branch === 'master');
|
|
22
22
|
const isSupportSnapshot = (!isMaster && !isSnapshot && branch.indexOf('support/develop') > -1);
|
|
23
23
|
const isSupport = (!isMaster && !isSnapshot && !isSupportSnapshot && branch.indexOf('support/') > -1);
|
|
24
|
-
const
|
|
24
|
+
const isHotfix = (!isMaster && !isSnapshot && !isSupportSnapshot && !isSupport && branch.indexOf('hotfix/') > -1);
|
|
25
|
+
const isNext = (!isMaster && !isSnapshot && !isSupport && !isSupportSnapshot && !isHotfix && branch.indexOf('next/') > -1);
|
|
25
26
|
|
|
26
27
|
return {
|
|
27
28
|
isSupport: isSupport,
|
|
@@ -29,6 +30,7 @@ module.exports.getBranches = () => {
|
|
|
29
30
|
isNext: isNext,
|
|
30
31
|
isSnapshot: isSnapshot,
|
|
31
32
|
isMaster: isMaster,
|
|
33
|
+
isHotfix: isHotfix,
|
|
32
34
|
branch: branch
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -178,7 +180,7 @@ module.exports.updateVersion = (pkg, pkgMetadata) => {
|
|
|
178
180
|
|
|
179
181
|
// GET NEW VERSION from VALID commits found in metadata
|
|
180
182
|
.then(() => {
|
|
181
|
-
return versionUtils.package.getNewVersion(pkg, pkgMetadata.commits, (branches.isSnapshot || branches.isSupportSnapshot), branches.isNext, branches.isSupport);
|
|
183
|
+
return versionUtils.package.getNewVersion(pkg, pkgMetadata.commits, (branches.isSnapshot || branches.isSupportSnapshot), branches.isNext, branches.isSupport, branches.isHotfix);
|
|
182
184
|
})
|
|
183
185
|
|
|
184
186
|
|
|
@@ -187,7 +189,7 @@ module.exports.updateVersion = (pkg, pkgMetadata) => {
|
|
|
187
189
|
newVersion = version;
|
|
188
190
|
|
|
189
191
|
if (!dryRun) {
|
|
190
|
-
return versionUtils.package.updateVersion(pkg, version, (branches.isSnapshot || branches.isSupportSnapshot), branches.isNext, branches.isSupport);
|
|
192
|
+
return versionUtils.package.updateVersion(pkg, version, (branches.isSnapshot || branches.isSupportSnapshot), branches.isNext, branches.isSupport, branches.isHotfix);
|
|
191
193
|
}
|
|
192
194
|
})
|
|
193
195
|
|
|
@@ -304,6 +306,13 @@ module.exports.runGitOperations = (pkg, version) => {
|
|
|
304
306
|
}
|
|
305
307
|
})
|
|
306
308
|
|
|
309
|
+
// MERGE BACK ON support/develop for support release for package that has a support/develop branch active
|
|
310
|
+
.then(() => {
|
|
311
|
+
if (branches.isSupport && pkg.build && pkg.build.supportDevelopBranch) {
|
|
312
|
+
return utils.git.mergeSupportToSupportDevelop(pkg, pkg.paths.pkgDirectory, branches.branch, pkg.build.supportDevelopBranch);
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
|
|
307
316
|
.catch((e) => {
|
|
308
317
|
throw e;
|
|
309
318
|
})
|
|
@@ -318,7 +327,7 @@ module.exports.storeMetadata = (pkg, version, pkgMetadata, pkgCompositeDeps, dur
|
|
|
318
327
|
.then(() => {
|
|
319
328
|
return metadataUtils.package.storeMetadata(
|
|
320
329
|
pkg, version, pkgMetadata,
|
|
321
|
-
branches.isSnapshot, branches.isMaster, branches.isSupport, branches.isNext, branches.isSupportSnapshot,
|
|
330
|
+
branches.isSnapshot, branches.isMaster, branches.isSupport, branches.isNext, branches.isSupportSnapshot, branches.isHotfix,
|
|
322
331
|
pkgCompositeDeps,
|
|
323
332
|
duration
|
|
324
333
|
);
|
|
@@ -82,13 +82,13 @@ module.exports.run = () => {
|
|
|
82
82
|
// INSTALL dependencies by type
|
|
83
83
|
.then(() => {
|
|
84
84
|
if (pkg.remote) {
|
|
85
|
-
return innerRemote.install(pkg, branches.isMaster, envTarget);
|
|
85
|
+
return innerRemote.install(pkg, branches.isMaster || branches.isHotfix || branches.isSupport, envTarget);
|
|
86
86
|
|
|
87
87
|
} else if (pkg.backend) {
|
|
88
|
-
return innerBackend.install(pkg, branches.isMaster);
|
|
88
|
+
return innerBackend.install(pkg, branches.isMaster || branches.isHotfix || branches.isSupport);
|
|
89
89
|
|
|
90
90
|
} else {
|
|
91
|
-
return innerUi.install(pkg, branches.isMaster);
|
|
91
|
+
return innerUi.install(pkg, branches.isMaster || branches.isHotfix || branches.isSupport);
|
|
92
92
|
}
|
|
93
93
|
})
|
|
94
94
|
.then((compositeDeps) => {
|
|
@@ -62,7 +62,7 @@ const getCurrentVersion = (pkg) => {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSupportBranch) => {
|
|
65
|
+
const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
|
|
66
66
|
return Promise.resolve()
|
|
67
67
|
.then(() => {
|
|
68
68
|
const pkgJsonFile = path.resolve(folder, 'package.json');
|
|
@@ -91,7 +91,7 @@ const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSu
|
|
|
91
91
|
})
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch) => {
|
|
94
|
+
const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
|
|
95
95
|
return Promise.resolve()
|
|
96
96
|
.then(() => {
|
|
97
97
|
tools.logTitle('updating package version');
|
|
@@ -99,11 +99,11 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
|
|
|
99
99
|
if (!pkg.parent) {
|
|
100
100
|
return Promise.resolve()
|
|
101
101
|
.then(() => {
|
|
102
|
-
return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch);
|
|
102
|
+
return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
|
|
103
103
|
})
|
|
104
104
|
.then(() => {
|
|
105
105
|
if (!pkg.element && !pkg.config) {
|
|
106
|
-
return writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch);
|
|
106
|
+
return writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
|
|
107
107
|
}
|
|
108
108
|
})
|
|
109
109
|
.catch((e) => {
|
|
@@ -113,7 +113,7 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
|
|
|
113
113
|
} else {
|
|
114
114
|
return Promise.resolve()
|
|
115
115
|
.then(() => {
|
|
116
|
-
return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch);
|
|
116
|
+
return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
|
|
117
117
|
})
|
|
118
118
|
.then(() => {
|
|
119
119
|
let linkedPackages = Object.keys(pkg.packages)
|
|
@@ -128,7 +128,7 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
|
|
|
128
128
|
.then((linkedPackages) => Promise.resolve().then(() => {
|
|
129
129
|
return linkedPackages.reduce((promise, pkg) => {
|
|
130
130
|
return promise.then(() => (
|
|
131
|
-
writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch)
|
|
131
|
+
writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch)
|
|
132
132
|
));
|
|
133
133
|
}, Promise.resolve());
|
|
134
134
|
}))
|
|
@@ -188,7 +188,7 @@ const writePomXml = (pkg, newVersion, isSnapshot, isForceTimestamp = true) => {
|
|
|
188
188
|
|
|
189
189
|
// PUBLIC METHODS
|
|
190
190
|
|
|
191
|
-
module.exports.getNewVersion = (pkg, commits, isSnapshot, isNextBranch, isSupportBranch) => {
|
|
191
|
+
module.exports.getNewVersion = (pkg, commits, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
|
|
192
192
|
return Promise.resolve()
|
|
193
193
|
.then(() => {
|
|
194
194
|
return getCurrentVersion(pkg);
|
|
@@ -264,6 +264,10 @@ module.exports.getNewVersion = (pkg, commits, isSnapshot, isNextBranch, isSuppor
|
|
|
264
264
|
newVersion = semver.inc(currentVersion, 'prerelease');
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
+
if (isHotfixBranch) {
|
|
268
|
+
newVersion = semver.inc(currentVersion, 'prerelease');
|
|
269
|
+
}
|
|
270
|
+
|
|
267
271
|
tools.logSuccess('new version generated : ' + newVersion);
|
|
268
272
|
|
|
269
273
|
return newVersion;
|
|
@@ -274,11 +278,11 @@ module.exports.getNewVersion = (pkg, commits, isSnapshot, isNextBranch, isSuppor
|
|
|
274
278
|
}
|
|
275
279
|
|
|
276
280
|
|
|
277
|
-
module.exports.updateVersion = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch) => {
|
|
281
|
+
module.exports.updateVersion = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
|
|
278
282
|
if (pkg.backend) {
|
|
279
283
|
return writePomXml(pkg, newVersion, isSnapshot);
|
|
280
284
|
}
|
|
281
285
|
else {
|
|
282
|
-
return writePackageJson(pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch);
|
|
286
|
+
return writePackageJson(pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
|
|
283
287
|
}
|
|
284
288
|
}
|
|
@@ -13,7 +13,7 @@ const preBuildUtils = require('../../pre-build/pre-build-utils');
|
|
|
13
13
|
let {
|
|
14
14
|
skipLint, skipTest, skipCompile, configuration, baseHref,
|
|
15
15
|
watch, dryRun, maxSpaceSize, statsJson, extraWebpackConfig, ci,
|
|
16
|
-
deployUrl, sourceMap
|
|
16
|
+
deployUrl, sourceMap, configEnvTarget
|
|
17
17
|
} = tools.getArgs();
|
|
18
18
|
|
|
19
19
|
|
|
@@ -33,12 +33,18 @@ const getProjectInfos = () => {
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
module.exports.angular = (envTarget, isSnapshot, version) => {
|
|
36
|
+
module.exports.angular = (envTarget, isSnapshot, version, configEnvTargetIn) => {
|
|
37
37
|
|
|
38
38
|
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
39
39
|
|
|
40
40
|
const currentProject = getProjectInfos();
|
|
41
41
|
|
|
42
|
+
// checking if configEnvTarget is passed as param, if not take the global script param
|
|
43
|
+
// as this angular build method can be called in stand-alone (outside of CSDR pipeline flow)
|
|
44
|
+
if (configEnvTargetIn) {
|
|
45
|
+
configEnvTarget = configEnvTargetIn;
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
// getting param from project config
|
|
43
49
|
if (currentProject.build) {
|
|
44
50
|
if (currentProject.build.skipLint) {
|
|
@@ -66,7 +72,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
|
|
|
66
72
|
})
|
|
67
73
|
|
|
68
74
|
.then(() => {
|
|
69
|
-
return preBuildUtils.projects.preBuild(currentProject, envTarget, true);
|
|
75
|
+
return preBuildUtils.projects.preBuild(currentProject, envTarget, true, configEnvTarget);
|
|
70
76
|
})
|
|
71
77
|
|
|
72
78
|
.then(() => {
|
|
@@ -88,11 +94,6 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
|
|
|
88
94
|
if (!skipLint) {
|
|
89
95
|
tools.logSuccess();
|
|
90
96
|
}
|
|
91
|
-
// temporary disable for v13 apps
|
|
92
|
-
// if (!skipLint) {
|
|
93
|
-
// tools.logInfo(`Styles Linting application...`);
|
|
94
|
-
// return tools.runScript(`stylelint **/*.scss`, currentProject.paths.angularPath);
|
|
95
|
-
// }
|
|
96
97
|
})
|
|
97
98
|
|
|
98
99
|
|
|
@@ -7,6 +7,7 @@ const semver = require('semver');
|
|
|
7
7
|
// LOCAL
|
|
8
8
|
const tools = require('./tools');
|
|
9
9
|
const configUtils = require('../csdr/config/config-utils');
|
|
10
|
+
const { getPackageConfig } = require('./notification/config');
|
|
10
11
|
// const versionUtils = require('./version-utils');
|
|
11
12
|
|
|
12
13
|
// FETCH ARGS
|
|
@@ -225,10 +226,50 @@ const mergeMasterToDevelop = (pkg, folder, version) => {
|
|
|
225
226
|
})
|
|
226
227
|
}
|
|
227
228
|
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
const mergeSupportToSupportDevelop = (pkg, folder, supportBranch, supportDevelopBranch) => {
|
|
233
|
+
if (!supportDevelopBranch) {
|
|
234
|
+
tools.logWarning('supportDevelopBranch not found in package config...skipping');
|
|
235
|
+
return Promise.resolve();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
tools.logTitle(`Merge back on ${supportDevelopBranch}`);
|
|
239
|
+
tools.logInfo(`Merging release changes into ${supportDevelopBranch} branch...`);
|
|
240
|
+
|
|
241
|
+
if (dryRun) {
|
|
242
|
+
tools.logInfo('DRY-RUN: skipping merge support to supportDevelop');
|
|
243
|
+
return Promise.resolve();
|
|
244
|
+
|
|
245
|
+
} else {
|
|
228
246
|
|
|
247
|
+
if (pkg && pkg.build && pkg.build.masterBranchOnly) {
|
|
248
|
+
tools.logInfo('Merge skipped project config set to master branch only');
|
|
249
|
+
return Promise.resolve();
|
|
250
|
+
|
|
251
|
+
} else {
|
|
252
|
+
return Promise.resolve()
|
|
253
|
+
.then(() => {
|
|
254
|
+
execa.shellSync(`git fetch origin`, { cwd: folder });
|
|
255
|
+
execa.shellSync(`git checkout ${supportDevelopBranch}`, { cwd: folder });
|
|
256
|
+
execa.shellSync(`git merge origin/${supportDevelopBranch}`, { cwd: folder });
|
|
257
|
+
execa.shellSync(`git merge -X theirs ${supportBranch}`, { cwd: folder });
|
|
258
|
+
execa.shellSync(`git push origin ${supportDevelopBranch}`, { cwd: folder });
|
|
259
|
+
execa.shellSync(`git checkout ${supportBranch}`, { cwd: folder });
|
|
260
|
+
})
|
|
261
|
+
.then(() => {
|
|
262
|
+
tools.logSuccess();
|
|
263
|
+
})
|
|
264
|
+
.catch((e) => {
|
|
265
|
+
throw new Error(`Error trying merging ${supportBranch} to ${supportDevelopBranch} on ${folder}`);
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
}
|
|
229
269
|
}
|
|
230
270
|
|
|
231
271
|
|
|
272
|
+
|
|
232
273
|
const getGitHost = (externalRepo) => {
|
|
233
274
|
const config = configUtils.global.getConfig();
|
|
234
275
|
|
|
@@ -338,6 +379,7 @@ module.exports.hasCommitsSinceLastTag = hasCommitsSinceLastTag;
|
|
|
338
379
|
module.exports.commitAndPush = commitAndPush;
|
|
339
380
|
module.exports.tagVersion = tagVersion;
|
|
340
381
|
module.exports.mergeMasterToDevelop = mergeMasterToDevelop;
|
|
382
|
+
module.exports.mergeSupportToSupportDevelop = mergeSupportToSupportDevelop;
|
|
341
383
|
module.exports.cloneRepo = cloneRepo;
|
|
342
384
|
module.exports.checkout = checkout;
|
|
343
385
|
module.exports.getLastCommitAuthor = getLastCommitAuthor;
|
|
@@ -9,10 +9,10 @@ const translationUtils = require('./translations/translation-utils');
|
|
|
9
9
|
|
|
10
10
|
const configUtils = require('../../csdr/config/config-utils');
|
|
11
11
|
|
|
12
|
-
let {
|
|
12
|
+
let { openid } = tools.getArgs();
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
module.exports.preBuild = (project, envTarget, build) => {
|
|
15
|
+
module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
|
|
16
16
|
|
|
17
17
|
return Promise.resolve()
|
|
18
18
|
|
|
@@ -111,7 +111,7 @@ module.exports.preBuild = (project, envTarget, build) => {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
if (configEnvTarget) {
|
|
114
|
-
return this.injectAppConfig(project, configEnvTarget
|
|
114
|
+
return this.injectAppConfig(project, configEnvTarget);
|
|
115
115
|
}
|
|
116
116
|
})
|
|
117
117
|
|
|
@@ -122,7 +122,7 @@ module.exports.preBuild = (project, envTarget, build) => {
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
|
|
125
|
-
module.exports.injectAppConfig = (project, configEnvTarget
|
|
125
|
+
module.exports.injectAppConfig = (project, configEnvTarget) => {
|
|
126
126
|
return Promise.resolve()
|
|
127
127
|
.then(() => {
|
|
128
128
|
tools.logInfo(`Executing configuration replacement for : ${configEnvTarget} environment`);
|
|
@@ -10,7 +10,7 @@ const configUtils = require('../../csdr/config/config-utils');
|
|
|
10
10
|
|
|
11
11
|
module.exports.serve = () => {
|
|
12
12
|
|
|
13
|
-
let { configuration, baseHref, host, proxyConfig, maxSpaceSize, port, disableHostCheck, open, debug } = tools.getArgs();
|
|
13
|
+
let { configuration, baseHref, host, proxyConfig, maxSpaceSize, port, disableHostCheck, open, debug, configEnvTarget } = tools.getArgs();
|
|
14
14
|
|
|
15
15
|
const prj = configUtils.projects.getProject();
|
|
16
16
|
|
|
@@ -38,7 +38,7 @@ module.exports.serve = () => {
|
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
.then(() => {
|
|
41
|
-
return preBuildUtils.projects.preBuild(prj, configuration, false);
|
|
41
|
+
return preBuildUtils.projects.preBuild(prj, configuration, false, configEnvTarget);
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
|
package/scripts/utils/tools.js
CHANGED
|
@@ -565,8 +565,6 @@ function getSysConfig() {
|
|
|
565
565
|
infos.httpsProxy = execSync('npm config get https-proxy').toString().trim();
|
|
566
566
|
const registry = execSync('npm config get registry').toString().trim();
|
|
567
567
|
|
|
568
|
-
infos.isRegistryEcDevops = registry.indexOf('ecdevops.eu') >= 0;
|
|
569
|
-
|
|
570
568
|
logSuccess();
|
|
571
569
|
|
|
572
570
|
return infos;
|