@eui/tools 6.20.6 → 6.20.7

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.
@@ -1 +1 @@
1
- 6.20.6
1
+ 6.20.7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.20.7 (2024-08-07)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * add authenticate git option for standalone pkg - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([ad7b09ab](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ad7b09ab47c955b25467d3fe18b69e95e155b03e))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.20.6 (2024-08-07)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.20.6",
3
+ "version": "6.20.7",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -255,6 +255,7 @@ module.exports.updateConfig = (args = { project, projects, packages, packagesBra
255
255
 
256
256
  const getConvertedOptions = (config) => {
257
257
  let configOptions = {
258
+ GIT_HOST_REMOTE: null,
258
259
  DEVOPS_METADATA_REPOSITORY: null,
259
260
  DEVOPS_METADATA_LOCKS_REPOSITORY: null,
260
261
  DEVOPS_METADATA_PATH: null,
@@ -282,6 +283,16 @@ const getConvertedOptions = (config) => {
282
283
  AUDIT_STYLES_GATES: null
283
284
  }
284
285
 
286
+ // getting issues manager options
287
+ const gitHost = config && config.git;
288
+
289
+ if (gitHost) {
290
+ if (gitHost.remote) {
291
+ configOptions.GIT_HOST_REMOTE = gitHost.remote;
292
+ }
293
+ }
294
+
295
+
285
296
  // getting devops metadata options
286
297
  const devopsMetadata = config && config.devopsMetadata;
287
298
 
@@ -234,6 +234,11 @@ module.exports.getPackagePaths = (pkg) => {
234
234
 
235
235
  module.exports.getStandalonePackage = () => {
236
236
  const basePath = path.join(process.cwd());
237
+ const { pkgName } = tools.getArgs();
238
+
239
+ if (!pkgName) {
240
+ throw new Error('pkgName not provided as pipeline argument');
241
+ }
237
242
 
238
243
  const packageJsonPath = path.join(basePath, 'package.json');
239
244
 
@@ -241,13 +246,14 @@ module.exports.getStandalonePackage = () => {
241
246
  throw new Error('PACKAGE_JSON_NOT_FOUND');
242
247
  }
243
248
 
244
- // get package.json information (name, current version)
249
+ // get package.json information (current version)
245
250
  const packageJson = require(packageJsonPath);
246
251
 
247
252
  const pkg = {
248
253
  csdr: false,
249
254
  standalone: true,
250
- ...packageJson,
255
+ name: pkgName,
256
+ version: packageJson.version,
251
257
  paths: {
252
258
  root: basePath,
253
259
  dist: path.join(basePath, 'dist'),
@@ -520,6 +520,11 @@ module.exports.runGitOperations = (pkg, version) => {
520
520
 
521
521
  console.log(branches);
522
522
 
523
+ // authenticate for standalone pkg
524
+ if (pkg.standalone) {
525
+ utils.git.authenticate(pkg, pkg.paths.root);
526
+ }
527
+
523
528
  if (pkg.remote && pkg.build && pkg.build.envTargetActive) {
524
529
  utils.tools.logInfo('Remote - with envTargetActive set - commit package only');
525
530
 
@@ -264,6 +264,21 @@ const getGitHost = (externalRepo) => {
264
264
  return '';
265
265
  }
266
266
 
267
+ const authenticate = (pkg, folder) => {
268
+ tools.logTitle('GIT authentication');
269
+
270
+ const auth = process.env.gituser && process.env.gitpassword ? `${process.env.gituser}:${process.env.gitpassword}@` : '';
271
+ const gitHost = configUtils.global.getConfigOptionsStandalone().GIT_HOST_REMOTE;
272
+
273
+ if (skipGitUpdates) {
274
+ tools.logInfo('DRY RUN - skipping');
275
+ tools.logInfo(`executing : for host: ${gitHost} - auth: ${auth} - pkgName: ${pkg.name}`);
276
+ } else {
277
+ execa.sync('git', ['remote', '--push', 'origin', `https://${auth}${gitHost}${pkg.name}.git`], { cwd: folder, stdio: 'inherit'});
278
+ }
279
+ }
280
+
281
+
267
282
 
268
283
  const cloneRepo = (repoUri, folder, forced = false, shallow = false, externalRepo = false) => {
269
284
  if (!repoUri) {
@@ -428,6 +443,7 @@ module.exports.tagVersion = tagVersion;
428
443
  module.exports.mergeMasterToDevelop = mergeMasterToDevelop;
429
444
  module.exports.mergeSupportToSupportDevelop = mergeSupportToSupportDevelop;
430
445
  module.exports.cloneRepo = cloneRepo;
446
+ module.exports.authenticate = authenticate;
431
447
  module.exports.checkout = checkout;
432
448
  module.exports.cloneAndCheckout = cloneAndCheckout;
433
449
  module.exports.getLastCommitAuthor = getLastCommitAuthor;