@docupace/pipeline 1.0.56 → 1.0.57

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 (44) 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/eslint.config.js +26 -26
  6. package/next/changeset.sh +75 -75
  7. package/next/copy.sh +34 -34
  8. package/next/deploy.sh +40 -40
  9. package/next/execute.sh +123 -123
  10. package/next/sonar.sh +23 -23
  11. package/package.json +50 -50
  12. package/src/auth0/alias.js +72 -72
  13. package/src/auth0/cli.js +0 -0
  14. package/src/auth0/export.js +43 -43
  15. package/src/auth0/metadata.js +132 -132
  16. package/src/auth0/vault.js +107 -107
  17. package/src/changeset/changeset-config.js +34 -34
  18. package/src/changeset/cli.js +200 -200
  19. package/src/changeset/create.js +205 -205
  20. package/src/changeset/package-util.js +86 -86
  21. package/src/changeset/util.js +43 -43
  22. package/src/changeset/validate.js +84 -84
  23. package/src/changeset/version.js +102 -102
  24. package/src/jenkins/setParams.groovy +58 -58
  25. package/src/next/alias.js +53 -53
  26. package/src/next/apache.js +81 -81
  27. package/src/next/cli.js +226 -228
  28. package/src/next/config.js +137 -137
  29. package/src/next/connect.js +227 -227
  30. package/src/next/copy.js +61 -61
  31. package/src/next/deploy.js +600 -595
  32. package/src/next/haproxy.js +75 -75
  33. package/src/next/jira.js +84 -84
  34. package/src/next/logger.js +17 -17
  35. package/src/next/pipline.js +114 -114
  36. package/src/next/publish.js +71 -71
  37. package/src/next/pull.js +7 -7
  38. package/src/next/sonar.js +23 -23
  39. package/src/next/util.js +93 -93
  40. package/src/next/vault.js +45 -45
  41. package/terraform/apply.sh +37 -37
  42. package/terraform/init.sh +72 -72
  43. package/terraform/plan.sh +76 -76
  44. package/terraform/validate.sh +17 -17
@@ -1,200 +1,200 @@
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
-
14
- dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
15
-
16
- const program = new Command();
17
-
18
- const args = process.argv;
19
-
20
- async function commitTagCommand(releases) {
21
- console.log('📌 Checking for updates to commit...');
22
-
23
- // Check if there are changes to commit
24
- const status = (await $`git status --porcelain`).stdout.trim();
25
- if (!status) {
26
- console.log('✅ No changes to commit. Exiting.');
27
- return;
28
- }
29
-
30
- console.log('📌 Committing and tagging the new version...');
31
- await setGitInfo();
32
- await $`git add .`;
33
-
34
- if (isMonoRepo()) {
35
- await commitTagMono(releases);
36
- } else {
37
- await commitTag();
38
- }
39
- }
40
-
41
- export function getAppReleases(releases) {
42
- const appReleases = releases.filter(
43
- (release) =>
44
- release.name.endsWith('-app') || release.name.endsWith('-template'),
45
- );
46
- return appReleases;
47
- }
48
-
49
- function getAppNameFromPackageName(packageName) {
50
- const appName = packageName.includes('/')
51
- ? packageName.split('/')[1]
52
- : packageName;
53
-
54
- return appName;
55
- }
56
-
57
- async function commitTagMono(releases) {
58
- let versions = [];
59
- for (const release of getAppReleases(releases)) {
60
- const newVersion = release.newVersion;
61
- const appName = getAppNameFromPackageName(release.name);
62
- versions.push(`${appName}@${newVersion}`);
63
- }
64
-
65
- const defaultBranch = process.env.BITBUCKET_BRANCH;
66
-
67
- if (!process.env.IS_DEV) {
68
- await $`git commit -m "Version bump to ${versions.join(',')} and changelog"`;
69
- await $`git push origin ${defaultBranch}`;
70
- } else {
71
- console.log(`Simulate Version bump to ${versions.join(',')} and changelog`);
72
- }
73
-
74
- for (const newVersion of versions) {
75
- if (!process.env.IS_DEV) {
76
- await $`git tag ${newVersion}`;
77
- console.log(`✅ Version ${newVersion} tagged.`);
78
- } else {
79
- console.log(`✅ Simulate Version ${newVersion} tagged.`);
80
- }
81
- }
82
-
83
- if (!process.env.IS_DEV) {
84
- await $`git push origin --tags`;
85
- console.log(`✅ Version pushed.`);
86
- } else {
87
- console.log(`✅ Simulate Version pushed.`);
88
- }
89
- }
90
-
91
- async function commitTag() {
92
- const newVersion = (
93
- await $`node -p "require('./package.json').version"`
94
- ).stdout.trim();
95
-
96
- const defaultBranch = process.env.BITBUCKET_BRANCH;
97
-
98
- await $`git commit -m "Version bump to ${newVersion} and changelog"`;
99
- await $`git push origin ${defaultBranch}`;
100
- await $`git tag v${newVersion}`;
101
- await $`git push origin --tags`;
102
- console.log(`✅ Version ${newVersion} tagged and pushed.`);
103
- }
104
-
105
- // Command: validate
106
- program
107
- .command('validate')
108
- .description('Validate changesets for the provided PR')
109
- .action(async () => {
110
- if (!process.env.BITBUCKET_PR_ID) {
111
- return;
112
- }
113
- console.log('🔍 Validating changesets...');
114
- try {
115
- await validateChangesets();
116
- console.log('✅ Changeset validation passed.');
117
- } catch {
118
- console.error(
119
- '❌ No changeset found. Please add a changeset to this PR. Please see more information at https://docupacellc.atlassian.net/wiki/spaces/PM/pages/1350893571/Creating+changesets+for+Docupace+Next',
120
- );
121
- process.exit(1);
122
- }
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 commitTagCommand(releases);
149
- });
150
-
151
- program
152
- .command('close-version')
153
- .description('Closes a version')
154
- .action(async () => {
155
- console.log('📦 Running all steps...');
156
- const releases = await versionCommand(true);
157
- await commitTagCommand(releases);
158
-
159
- const { stdout: currentBranch } = await $`git rev-parse --abbrev-ref HEAD`;
160
-
161
- if (isMonoRepo()) {
162
- for (const release of getAppReleases(releases)) {
163
- const appName = getAppNameFromPackageName(release.name);
164
- const newVersion = toShortVersion(release.newVersion);
165
- if (!newVersion) {
166
- throw new Error('Error calculating branch name');
167
- }
168
- await $`git checkout -b release/${appName}/${newVersion}`;
169
- await $`git push origin release/${appName}/${newVersion}`;
170
- }
171
- } else {
172
- const newVersion = toShortVersion(releases[0].newVersion);
173
- if (!newVersion) {
174
- throw new Error('Error calculating branch name');
175
- }
176
- await $`git checkout -b release/${newVersion}`;
177
- await $`git push origin release/${newVersion}`;
178
- }
179
-
180
- // Return to original branch
181
- await $`git checkout ${currentBranch.trim()}`;
182
-
183
- // Open next alpha version
184
- await $`pnpm changeset pre enter alpha`;
185
- await $`git add .`;
186
- await $`git commit -m "Open next alpha version"`;
187
- await $`git push origin`;
188
- });
189
-
190
- program
191
- .name('create-changeset')
192
- .description(
193
- 'Creates a changeset based on the current branch and Jira ticket information',
194
- )
195
- .action(async () => {
196
- await createChangeset();
197
- });
198
-
199
- // Parse arguments
200
- 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
+
14
+ dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
15
+
16
+ const program = new Command();
17
+
18
+ const args = process.argv;
19
+
20
+ async function commitTagCommand(releases) {
21
+ console.log('📌 Checking for updates to commit...');
22
+
23
+ // Check if there are changes to commit
24
+ const status = (await $`git status --porcelain`).stdout.trim();
25
+ if (!status) {
26
+ console.log('✅ No changes to commit. Exiting.');
27
+ return;
28
+ }
29
+
30
+ console.log('📌 Committing and tagging the new version...');
31
+ await setGitInfo();
32
+ await $`git add .`;
33
+
34
+ if (isMonoRepo()) {
35
+ await commitTagMono(releases);
36
+ } else {
37
+ await commitTag();
38
+ }
39
+ }
40
+
41
+ export function getAppReleases(releases) {
42
+ const appReleases = releases.filter(
43
+ (release) =>
44
+ release.name.endsWith('-app') || release.name.endsWith('-template'),
45
+ );
46
+ return appReleases;
47
+ }
48
+
49
+ function getAppNameFromPackageName(packageName) {
50
+ const appName = packageName.includes('/')
51
+ ? packageName.split('/')[1]
52
+ : packageName;
53
+
54
+ return appName;
55
+ }
56
+
57
+ async function commitTagMono(releases) {
58
+ let versions = [];
59
+ for (const release of getAppReleases(releases)) {
60
+ const newVersion = release.newVersion;
61
+ const appName = getAppNameFromPackageName(release.name);
62
+ versions.push(`${appName}@${newVersion}`);
63
+ }
64
+
65
+ const defaultBranch = process.env.BITBUCKET_BRANCH;
66
+
67
+ if (!process.env.IS_DEV) {
68
+ await $`git commit -m "Version bump to ${versions.join(',')} and changelog"`;
69
+ await $`git push origin ${defaultBranch}`;
70
+ } else {
71
+ console.log(`Simulate Version bump to ${versions.join(',')} and changelog`);
72
+ }
73
+
74
+ for (const newVersion of versions) {
75
+ if (!process.env.IS_DEV) {
76
+ await $`git tag ${newVersion}`;
77
+ console.log(`✅ Version ${newVersion} tagged.`);
78
+ } else {
79
+ console.log(`✅ Simulate Version ${newVersion} tagged.`);
80
+ }
81
+ }
82
+
83
+ if (!process.env.IS_DEV) {
84
+ await $`git push origin --tags`;
85
+ console.log(`✅ Version pushed.`);
86
+ } else {
87
+ console.log(`✅ Simulate Version pushed.`);
88
+ }
89
+ }
90
+
91
+ async function commitTag() {
92
+ const newVersion = (
93
+ await $`node -p "require('./package.json').version"`
94
+ ).stdout.trim();
95
+
96
+ const defaultBranch = process.env.BITBUCKET_BRANCH;
97
+
98
+ await $`git commit -m "Version bump to ${newVersion} and changelog"`;
99
+ await $`git push origin ${defaultBranch}`;
100
+ await $`git tag v${newVersion}`;
101
+ await $`git push origin --tags`;
102
+ console.log(`✅ Version ${newVersion} tagged and pushed.`);
103
+ }
104
+
105
+ // Command: validate
106
+ program
107
+ .command('validate')
108
+ .description('Validate changesets for the provided PR')
109
+ .action(async () => {
110
+ if (!process.env.BITBUCKET_PR_ID) {
111
+ return;
112
+ }
113
+ console.log('🔍 Validating changesets...');
114
+ try {
115
+ await validateChangesets();
116
+ console.log('✅ Changeset validation passed.');
117
+ } catch {
118
+ console.error(
119
+ '❌ No changeset found. Please add a changeset to this PR. Please see more information at https://docupacellc.atlassian.net/wiki/spaces/PM/pages/1350893571/Creating+changesets+for+Docupace+Next',
120
+ );
121
+ process.exit(1);
122
+ }
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 commitTagCommand(releases);
149
+ });
150
+
151
+ program
152
+ .command('close-version')
153
+ .description('Closes a version')
154
+ .action(async () => {
155
+ console.log('📦 Running all steps...');
156
+ const releases = await versionCommand(true);
157
+ await commitTagCommand(releases);
158
+
159
+ const { stdout: currentBranch } = await $`git rev-parse --abbrev-ref HEAD`;
160
+
161
+ if (isMonoRepo()) {
162
+ for (const release of getAppReleases(releases)) {
163
+ const appName = getAppNameFromPackageName(release.name);
164
+ const newVersion = toShortVersion(release.newVersion);
165
+ if (!newVersion) {
166
+ throw new Error('Error calculating branch name');
167
+ }
168
+ await $`git checkout -b release/${appName}/${newVersion}`;
169
+ await $`git push origin release/${appName}/${newVersion}`;
170
+ }
171
+ } else {
172
+ const newVersion = toShortVersion(releases[0].newVersion);
173
+ if (!newVersion) {
174
+ throw new Error('Error calculating branch name');
175
+ }
176
+ await $`git checkout -b release/${newVersion}`;
177
+ await $`git push origin release/${newVersion}`;
178
+ }
179
+
180
+ // Return to original branch
181
+ await $`git checkout ${currentBranch.trim()}`;
182
+
183
+ // Open next alpha version
184
+ await $`pnpm changeset pre enter alpha`;
185
+ await $`git add .`;
186
+ await $`git commit -m "Open next alpha version"`;
187
+ await $`git push origin`;
188
+ });
189
+
190
+ program
191
+ .name('create-changeset')
192
+ .description(
193
+ 'Creates a changeset based on the current branch and Jira ticket information',
194
+ )
195
+ .action(async () => {
196
+ await createChangeset();
197
+ });
198
+
199
+ // Parse arguments
200
+ program.parse(args);