@docupace/pipeline 1.0.48 → 1.0.50

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