@docupace/pipeline 1.0.54 → 1.0.56
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/.prettierrc.cjs +12 -12
- package/README.md +135 -135
- package/bin/azuread_update_callbacks_for_app.sh +58 -58
- package/bin/next-changeset-validate.sh +8 -8
- package/eslint.config.js +26 -26
- package/next/changeset.sh +75 -75
- package/next/copy.sh +34 -34
- package/next/deploy.sh +40 -40
- package/next/execute.sh +123 -123
- package/next/sonar.sh +23 -23
- package/package.json +50 -50
- package/src/auth0/alias.js +72 -72
- package/src/auth0/cli.js +0 -0
- package/src/auth0/export.js +43 -43
- package/src/auth0/metadata.js +132 -132
- package/src/auth0/vault.js +107 -107
- package/src/changeset/changeset-config.js +34 -34
- package/src/changeset/cli.js +200 -200
- package/src/changeset/create.js +205 -205
- package/src/changeset/package-util.js +86 -86
- package/src/changeset/util.js +43 -43
- package/src/changeset/validate.js +84 -84
- package/src/changeset/version.js +102 -102
- package/src/jenkins/setParams.groovy +58 -58
- package/src/next/alias.js +53 -53
- package/src/next/apache.js +81 -73
- package/src/next/cli.js +228 -228
- package/src/next/config.js +137 -136
- package/src/next/connect.js +227 -227
- package/src/next/copy.js +61 -61
- package/src/next/deploy.js +595 -595
- package/src/next/haproxy.js +75 -71
- package/src/next/jira.js +84 -84
- package/src/next/logger.js +17 -17
- package/src/next/pipline.js +114 -114
- package/src/next/publish.js +71 -71
- package/src/next/pull.js +7 -7
- package/src/next/sonar.js +23 -23
- package/src/next/util.js +93 -93
- package/src/next/vault.js +45 -45
- package/terraform/apply.sh +37 -37
- package/terraform/init.sh +72 -72
- package/terraform/plan.sh +76 -76
- package/terraform/validate.sh +17 -17
package/src/changeset/cli.js
CHANGED
|
@@ -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);
|