@docupace/pipeline 1.0.77 → 1.0.79

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.
Files changed (69) hide show
  1. package/.prettierrc.cjs +12 -12
  2. package/README.md +135 -135
  3. package/bin/azuread_update_callbacks_for_app.sh +58 -58
  4. package/bin/next-changeset-validate.sh +8 -8
  5. package/bitbucket-pipelines.yml +59 -59
  6. package/eslint.config.js +49 -49
  7. package/jest.config.js +15 -15
  8. package/next/changeset.sh +75 -75
  9. package/next/copy.sh +34 -34
  10. package/next/deploy.sh +40 -40
  11. package/next/execute.sh +123 -123
  12. package/next/sonar.sh +23 -23
  13. package/package.json +1 -1
  14. package/src/auth0/alias.js +79 -79
  15. package/src/auth0/alias.test.js +172 -172
  16. package/src/auth0/cli.js +82 -82
  17. package/src/auth0/configure.js +902 -902
  18. package/src/auth0/configure.test.js +167 -167
  19. package/src/auth0/export.js +48 -48
  20. package/src/auth0/export.test.js +103 -103
  21. package/src/auth0/metadata.js +141 -141
  22. package/src/auth0/metadata.test.js +186 -186
  23. package/src/auth0/vault.js +60 -60
  24. package/src/auth0/vault.test.js +134 -134
  25. package/src/changeset/changelog-wiki.js +328 -328
  26. package/src/changeset/changeset-config.js +34 -34
  27. package/src/changeset/cli.js +237 -237
  28. package/src/changeset/create.js +215 -215
  29. package/src/changeset/package-util.js +87 -87
  30. package/src/changeset/util.js +43 -43
  31. package/src/changeset/validate.js +91 -91
  32. package/src/changeset/version.js +102 -102
  33. package/src/jenkins/setParams.groovy +58 -58
  34. package/src/lib/merge-driver.js +204 -204
  35. package/src/merge/cli-merge-all.js +507 -507
  36. package/src/merge/cli-merge.js +492 -492
  37. package/src/merge/cli-resolve.js +399 -399
  38. package/src/merge/cli.js +38 -38
  39. package/src/merge/merge-changelog.js +87 -87
  40. package/src/merge/merge-package.js +106 -106
  41. package/src/merge/merge-types.js +82 -82
  42. package/src/merge/pr.js +231 -231
  43. package/src/micro/deploy-microservice.js +153 -0
  44. package/src/micro/{ms-publish.js → publish-ms.js} +8 -6
  45. package/src/next/alias.js +53 -53
  46. package/src/next/apache.js +81 -81
  47. package/src/next/cli.js +10 -1
  48. package/src/next/config.js +137 -137
  49. package/src/next/connect.js +226 -226
  50. package/src/next/copy.js +61 -61
  51. package/src/next/deploy.js +666 -633
  52. package/src/next/git-to-semver.js +79 -79
  53. package/src/next/haproxy.js +76 -76
  54. package/src/next/jenkins.js +123 -123
  55. package/src/next/jira.js +84 -84
  56. package/src/next/logger.js +17 -17
  57. package/src/next/pipline.js +114 -114
  58. package/src/next/publish.js +71 -71
  59. package/src/next/pull.js +7 -7
  60. package/src/next/sonar.js +23 -23
  61. package/src/next/test.js +5 -5
  62. package/src/next/util.js +95 -93
  63. package/src/next/vault.js +45 -45
  64. package/terraform/apply.sh +37 -37
  65. package/terraform/init.sh +72 -72
  66. package/terraform/plan.sh +76 -76
  67. package/terraform/validate.sh +17 -17
  68. package/src/micro/cli.js +0 -71
  69. package/src/micro/ms-deploy.js +0 -271
@@ -1,34 +1,34 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- // Get absolute path to .changeset/config.json using current working directory
5
- const configPath = path.join(process.cwd(), '.changeset', 'config.json');
6
-
7
- // Function to update baseBranch to BITBUCKET_BRANCH
8
- export function updateBaseBranch() {
9
- const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
10
- if (!process.env.BITBUCKET_BRANCH) {
11
- return null;
12
- }
13
- let originalbaseBranch = config.baseBranch;
14
- config.baseBranch = process.env.BITBUCKET_BRANCH;
15
-
16
- if (!config.baseBranch) {
17
- throw new Error('BITBUCKET_BRANCH environment variable is not set.');
18
- }
19
-
20
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
21
- console.log(`baseBranch updated to ${process.env.BITBUCKET_BRANCH}`);
22
-
23
- return originalbaseBranch;
24
- }
25
-
26
- // Function to revert baseBranch to original value
27
- export function revertBaseBranch(originalBaseBranch) {
28
- if (!originalBaseBranch) return;
29
-
30
- const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
31
- config.baseBranch = originalBaseBranch;
32
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
33
- console.log(`baseBranch reverted to ${originalBaseBranch}`);
34
- }
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ // Get absolute path to .changeset/config.json using current working directory
5
+ const configPath = path.join(process.cwd(), '.changeset', 'config.json');
6
+
7
+ // Function to update baseBranch to BITBUCKET_BRANCH
8
+ export function updateBaseBranch() {
9
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
10
+ if (!process.env.BITBUCKET_BRANCH) {
11
+ return null;
12
+ }
13
+ let originalbaseBranch = config.baseBranch;
14
+ config.baseBranch = process.env.BITBUCKET_BRANCH;
15
+
16
+ if (!config.baseBranch) {
17
+ throw new Error('BITBUCKET_BRANCH environment variable is not set.');
18
+ }
19
+
20
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
21
+ console.log(`baseBranch updated to ${process.env.BITBUCKET_BRANCH}`);
22
+
23
+ return originalbaseBranch;
24
+ }
25
+
26
+ // Function to revert baseBranch to original value
27
+ export function revertBaseBranch(originalBaseBranch) {
28
+ if (!originalBaseBranch) return;
29
+
30
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
31
+ config.baseBranch = originalBaseBranch;
32
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
33
+ console.log(`baseBranch reverted to ${originalBaseBranch}`);
34
+ }
@@ -1,237 +1,237 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import { $ } from 'zx';
4
- import { validateChangesets } from './validate.js';
5
- import dotenv from 'dotenv';
6
- import { isMonoRepo, setGitInfo } from '../next/util.js';
7
- import {
8
- toShortVersion,
9
- updateJiraWithVersion,
10
- versionCommand,
11
- } from './version.js';
12
- import { createChangeset } from './create.js';
13
- import {
14
- updateWikiWithVersion,
15
- upsertReleaseNotesFromFile,
16
- } from './changelog-wiki.js';
17
-
18
- dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
19
-
20
- const program = new Command();
21
-
22
- const args = process.argv;
23
-
24
- async function commitTagCommand(releases) {
25
- console.log('📌 Checking for updates to commit...');
26
-
27
- // Check if there are changes to commit
28
- const status = (await $`git status --porcelain`).stdout.trim();
29
- if (!status) {
30
- console.log('✅ No changes to commit. Exiting.');
31
- return;
32
- }
33
-
34
- console.log('📌 Committing and tagging the new version...');
35
- await setGitInfo();
36
- await $`git add .`;
37
-
38
- if (isMonoRepo()) {
39
- await commitTagMono(releases);
40
- } else {
41
- await commitTag();
42
- }
43
- }
44
-
45
- export function getAppReleases(releases) {
46
- const appReleases = releases.filter(
47
- (release) =>
48
- release.name.endsWith('-app') || release.name.endsWith('-template'),
49
- );
50
- return appReleases;
51
- }
52
-
53
- function getAppNameFromPackageName(packageName) {
54
- const appName = packageName.includes('/')
55
- ? packageName.split('/')[1]
56
- : packageName;
57
-
58
- return appName;
59
- }
60
-
61
- async function commitTagMono(releases) {
62
- let versions = [];
63
- for (const release of getAppReleases(releases)) {
64
- const newVersion = release.newVersion;
65
- const appName = getAppNameFromPackageName(release.name);
66
- versions.push(`${appName}@${newVersion}`);
67
- }
68
-
69
- const defaultBranch = process.env.BITBUCKET_BRANCH;
70
-
71
- if (!process.env.IS_DEV) {
72
- await $`git commit -m "Version bump to ${versions.join(',')} and changelog"`;
73
- await $`git push origin ${defaultBranch}`;
74
- } else {
75
- console.log(`Simulate Version bump to ${versions.join(',')} and changelog`);
76
- }
77
-
78
- for (const newVersion of versions) {
79
- if (!process.env.IS_DEV) {
80
- await $`git tag ${newVersion}`;
81
- console.log(`✅ Version ${newVersion} tagged.`);
82
- } else {
83
- console.log(`✅ Simulate Version ${newVersion} tagged.`);
84
- }
85
- }
86
-
87
- if (!process.env.IS_DEV) {
88
- await $`git push origin --tags`;
89
- console.log(`✅ Version pushed.`);
90
- } else {
91
- console.log(`✅ Simulate Version pushed.`);
92
- }
93
- }
94
-
95
- async function commitTag() {
96
- const newVersion = (
97
- await $`node -p "require('./package.json').version"`
98
- ).stdout.trim();
99
-
100
- if (process.env.IS_DEV) {
101
- console.log(`Simulate commit of version ${newVersion}`);
102
- return;
103
- }
104
-
105
- const defaultBranch = process.env.BITBUCKET_BRANCH;
106
-
107
- await $`git commit -m "Version bump to ${newVersion} and changelog"`;
108
- await $`git push origin ${defaultBranch}`;
109
- await $`git tag v${newVersion}`;
110
- await $`git push origin --tags`;
111
- console.log(`✅ Version ${newVersion} tagged and pushed.`);
112
- }
113
-
114
- // Command: validate
115
- program
116
- .command('validate')
117
- .description('Validate changesets for the provided PR')
118
- .action(async () => {
119
- if (!process.env.BITBUCKET_PR_ID) {
120
- return;
121
- }
122
- await validateChangesets();
123
- });
124
- // Command: version
125
- program
126
- .command('version')
127
- .description('Run Changeset versioning')
128
- .action(async () => {
129
- await versionCommand();
130
- });
131
-
132
- // Command: commit-and-tag
133
- program
134
- .command('commit-tag')
135
- .description('Commit and tag the new version')
136
- .action(async () => {
137
- await commitTagCommand();
138
- });
139
-
140
- // Command: all
141
- program
142
- .command('version-commit-tag')
143
- .description('Run versioning and commit-and-tag in sequence')
144
- .action(async () => {
145
- console.log('📦 Running all steps...');
146
- const releases = await versionCommand();
147
- await updateJiraWithVersion(releases);
148
- await updateWikiWithVersion(releases);
149
- await commitTagCommand(releases);
150
- });
151
-
152
- program
153
- .command('close-version')
154
- .description('Closes a version')
155
- .action(async () => {
156
- console.log('📦 Running all steps...');
157
- const releases = await versionCommand(true);
158
- await commitTagCommand(releases);
159
-
160
- const { stdout: currentBranch } = await $`git rev-parse --abbrev-ref HEAD`;
161
-
162
- if (isMonoRepo()) {
163
- for (const release of getAppReleases(releases)) {
164
- const appName = getAppNameFromPackageName(release.name);
165
- const newVersion = toShortVersion(release.newVersion);
166
- if (!newVersion) {
167
- throw new Error('Error calculating branch name');
168
- }
169
- await $`git checkout -b release/${appName}/${newVersion}`;
170
- await $`git push origin release/${appName}/${newVersion}`;
171
- }
172
- } else {
173
- const newVersion = toShortVersion(releases[0].newVersion);
174
- if (!newVersion) {
175
- throw new Error('Error calculating branch name');
176
- }
177
- await $`git checkout -b release/${newVersion}`;
178
- await $`git push origin release/${newVersion}`;
179
- }
180
-
181
- // Return to original branch
182
- await $`git checkout ${currentBranch.trim()}`;
183
-
184
- // Open next alpha version
185
- await $`pnpm changeset pre enter alpha`;
186
- await $`git add .`;
187
- await $`git commit -m "Open next alpha version"`;
188
- await $`git push origin`;
189
- });
190
-
191
- program
192
- .name('create-changeset')
193
- .description(
194
- 'Creates a changeset based on the current branch and Jira ticket information',
195
- )
196
- .action(async () => {
197
- await createChangeset();
198
- });
199
-
200
- program
201
- .command('upload-wiki')
202
- .description('Upload release notes from markdown file to Confluence')
203
- .requiredOption(
204
- '-v, --version <version>',
205
- 'Version title (e.g., "Version 1.0")',
206
- )
207
- .requiredOption(
208
- '-c, --component <component>',
209
- 'Component title (e.g., "Component A")',
210
- )
211
- .requiredOption('-f, --file <file>', 'Path to markdown file')
212
- .requiredOption('-g, --group <group>', 'Group of release notes')
213
-
214
- .action(async (options) => {
215
- try {
216
- console.log('📤 Uploading release notes to Confluence...');
217
- const { versionPage, componentPage } = await upsertReleaseNotesFromFile({
218
- version: options.version,
219
- component: options.component,
220
- markdownFile: options.file,
221
- group: options.group,
222
- });
223
-
224
- console.log('✅ Successfully uploaded to Confluence');
225
- console.log('Version page:', versionPage._links?.webui || versionPage.id);
226
- console.log(
227
- 'Component page:',
228
- componentPage._links?.webui || componentPage.id,
229
- );
230
- } catch (error) {
231
- console.error('❌ Error uploading to Confluence:', error.message);
232
- process.exit(1);
233
- }
234
- });
235
-
236
- // Parse arguments
237
- program.parse(args);
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { $ } from 'zx';
4
+ import { validateChangesets } from './validate.js';
5
+ import dotenv from 'dotenv';
6
+ import { isMonoRepo, setGitInfo } from '../next/util.js';
7
+ import {
8
+ toShortVersion,
9
+ updateJiraWithVersion,
10
+ versionCommand,
11
+ } from './version.js';
12
+ import { createChangeset } from './create.js';
13
+ import {
14
+ updateWikiWithVersion,
15
+ upsertReleaseNotesFromFile,
16
+ } from './changelog-wiki.js';
17
+
18
+ dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
19
+
20
+ const program = new Command();
21
+
22
+ const args = process.argv;
23
+
24
+ async function commitTagCommand(releases) {
25
+ console.log('📌 Checking for updates to commit...');
26
+
27
+ // Check if there are changes to commit
28
+ const status = (await $`git status --porcelain`).stdout.trim();
29
+ if (!status) {
30
+ console.log('✅ No changes to commit. Exiting.');
31
+ return;
32
+ }
33
+
34
+ console.log('📌 Committing and tagging the new version...');
35
+ await setGitInfo();
36
+ await $`git add .`;
37
+
38
+ if (isMonoRepo()) {
39
+ await commitTagMono(releases);
40
+ } else {
41
+ await commitTag();
42
+ }
43
+ }
44
+
45
+ export function getAppReleases(releases) {
46
+ const appReleases = releases.filter(
47
+ (release) =>
48
+ release.name.endsWith('-app') || release.name.endsWith('-template'),
49
+ );
50
+ return appReleases;
51
+ }
52
+
53
+ function getAppNameFromPackageName(packageName) {
54
+ const appName = packageName.includes('/')
55
+ ? packageName.split('/')[1]
56
+ : packageName;
57
+
58
+ return appName;
59
+ }
60
+
61
+ async function commitTagMono(releases) {
62
+ let versions = [];
63
+ for (const release of getAppReleases(releases)) {
64
+ const newVersion = release.newVersion;
65
+ const appName = getAppNameFromPackageName(release.name);
66
+ versions.push(`${appName}@${newVersion}`);
67
+ }
68
+
69
+ const defaultBranch = process.env.BITBUCKET_BRANCH;
70
+
71
+ if (!process.env.IS_DEV) {
72
+ await $`git commit -m "Version bump to ${versions.join(',')} and changelog"`;
73
+ await $`git push origin ${defaultBranch}`;
74
+ } else {
75
+ console.log(`Simulate Version bump to ${versions.join(',')} and changelog`);
76
+ }
77
+
78
+ for (const newVersion of versions) {
79
+ if (!process.env.IS_DEV) {
80
+ await $`git tag ${newVersion}`;
81
+ console.log(`✅ Version ${newVersion} tagged.`);
82
+ } else {
83
+ console.log(`✅ Simulate Version ${newVersion} tagged.`);
84
+ }
85
+ }
86
+
87
+ if (!process.env.IS_DEV) {
88
+ await $`git push origin --tags`;
89
+ console.log(`✅ Version pushed.`);
90
+ } else {
91
+ console.log(`✅ Simulate Version pushed.`);
92
+ }
93
+ }
94
+
95
+ async function commitTag() {
96
+ const newVersion = (
97
+ await $`node -p "require('./package.json').version"`
98
+ ).stdout.trim();
99
+
100
+ if (process.env.IS_DEV) {
101
+ console.log(`Simulate commit of version ${newVersion}`);
102
+ return;
103
+ }
104
+
105
+ const defaultBranch = process.env.BITBUCKET_BRANCH;
106
+
107
+ await $`git commit -m "Version bump to ${newVersion} and changelog"`;
108
+ await $`git push origin ${defaultBranch}`;
109
+ await $`git tag v${newVersion}`;
110
+ await $`git push origin --tags`;
111
+ console.log(`✅ Version ${newVersion} tagged and pushed.`);
112
+ }
113
+
114
+ // Command: validate
115
+ program
116
+ .command('validate')
117
+ .description('Validate changesets for the provided PR')
118
+ .action(async () => {
119
+ if (!process.env.BITBUCKET_PR_ID) {
120
+ return;
121
+ }
122
+ await validateChangesets();
123
+ });
124
+ // Command: version
125
+ program
126
+ .command('version')
127
+ .description('Run Changeset versioning')
128
+ .action(async () => {
129
+ await versionCommand();
130
+ });
131
+
132
+ // Command: commit-and-tag
133
+ program
134
+ .command('commit-tag')
135
+ .description('Commit and tag the new version')
136
+ .action(async () => {
137
+ await commitTagCommand();
138
+ });
139
+
140
+ // Command: all
141
+ program
142
+ .command('version-commit-tag')
143
+ .description('Run versioning and commit-and-tag in sequence')
144
+ .action(async () => {
145
+ console.log('📦 Running all steps...');
146
+ const releases = await versionCommand();
147
+ await updateJiraWithVersion(releases);
148
+ await updateWikiWithVersion(releases);
149
+ await commitTagCommand(releases);
150
+ });
151
+
152
+ program
153
+ .command('close-version')
154
+ .description('Closes a version')
155
+ .action(async () => {
156
+ console.log('📦 Running all steps...');
157
+ const releases = await versionCommand(true);
158
+ await commitTagCommand(releases);
159
+
160
+ const { stdout: currentBranch } = await $`git rev-parse --abbrev-ref HEAD`;
161
+
162
+ if (isMonoRepo()) {
163
+ for (const release of getAppReleases(releases)) {
164
+ const appName = getAppNameFromPackageName(release.name);
165
+ const newVersion = toShortVersion(release.newVersion);
166
+ if (!newVersion) {
167
+ throw new Error('Error calculating branch name');
168
+ }
169
+ await $`git checkout -b release/${appName}/${newVersion}`;
170
+ await $`git push origin release/${appName}/${newVersion}`;
171
+ }
172
+ } else {
173
+ const newVersion = toShortVersion(releases[0].newVersion);
174
+ if (!newVersion) {
175
+ throw new Error('Error calculating branch name');
176
+ }
177
+ await $`git checkout -b release/${newVersion}`;
178
+ await $`git push origin release/${newVersion}`;
179
+ }
180
+
181
+ // Return to original branch
182
+ await $`git checkout ${currentBranch.trim()}`;
183
+
184
+ // Open next alpha version
185
+ await $`pnpm changeset pre enter alpha`;
186
+ await $`git add .`;
187
+ await $`git commit -m "Open next alpha version"`;
188
+ await $`git push origin`;
189
+ });
190
+
191
+ program
192
+ .name('create-changeset')
193
+ .description(
194
+ 'Creates a changeset based on the current branch and Jira ticket information',
195
+ )
196
+ .action(async () => {
197
+ await createChangeset();
198
+ });
199
+
200
+ program
201
+ .command('upload-wiki')
202
+ .description('Upload release notes from markdown file to Confluence')
203
+ .requiredOption(
204
+ '-v, --version <version>',
205
+ 'Version title (e.g., "Version 1.0")',
206
+ )
207
+ .requiredOption(
208
+ '-c, --component <component>',
209
+ 'Component title (e.g., "Component A")',
210
+ )
211
+ .requiredOption('-f, --file <file>', 'Path to markdown file')
212
+ .requiredOption('-g, --group <group>', 'Group of release notes')
213
+
214
+ .action(async (options) => {
215
+ try {
216
+ console.log('📤 Uploading release notes to Confluence...');
217
+ const { versionPage, componentPage } = await upsertReleaseNotesFromFile({
218
+ version: options.version,
219
+ component: options.component,
220
+ markdownFile: options.file,
221
+ group: options.group,
222
+ });
223
+
224
+ console.log('✅ Successfully uploaded to Confluence');
225
+ console.log('Version page:', versionPage._links?.webui || versionPage.id);
226
+ console.log(
227
+ 'Component page:',
228
+ componentPage._links?.webui || componentPage.id,
229
+ );
230
+ } catch (error) {
231
+ console.error('❌ Error uploading to Confluence:', error.message);
232
+ process.exit(1);
233
+ }
234
+ });
235
+
236
+ // Parse arguments
237
+ program.parse(args);