polyci 0.0.3 → 0.0.5
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/dist/main.js +33 -30
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -111,8 +111,8 @@ function appendModuleBuildJob(lines, module, branchRule) {
|
|
|
111
111
|
lines.push(`${module.jobId}_build:`);
|
|
112
112
|
lines.push(" stage: build");
|
|
113
113
|
lines.push(" rules:");
|
|
114
|
-
lines.push("
|
|
115
|
-
lines.push(`
|
|
114
|
+
lines.push(" - changes:");
|
|
115
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
116
116
|
lines.push(" image: $IMAGE_NODE");
|
|
117
117
|
lines.push(" variables:");
|
|
118
118
|
lines.push(` MODULE_NAME: ${module.moduleName}`);
|
|
@@ -132,8 +132,8 @@ function appendModuleTestJob(lines, module, branchRule) {
|
|
|
132
132
|
lines.push(`${module.jobId}_test:`);
|
|
133
133
|
lines.push(" stage: test");
|
|
134
134
|
lines.push(" rules:");
|
|
135
|
-
lines.push("
|
|
136
|
-
lines.push(`
|
|
135
|
+
lines.push(" - changes:");
|
|
136
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
137
137
|
lines.push(" needs:");
|
|
138
138
|
lines.push(` - job: ${module.jobId}_build`);
|
|
139
139
|
lines.push(" image: $IMAGE_LINUX");
|
|
@@ -150,8 +150,8 @@ function appendModuleReleaseJob(lines, module, branchRule) {
|
|
|
150
150
|
lines.push(`${module.jobId}_release:`);
|
|
151
151
|
lines.push(" stage: release");
|
|
152
152
|
lines.push(" rules:");
|
|
153
|
-
lines.push("
|
|
154
|
-
lines.push(`
|
|
153
|
+
lines.push(" - changes:");
|
|
154
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
155
155
|
lines.push(" needs:");
|
|
156
156
|
lines.push(` - job: ${module.jobId}_build`);
|
|
157
157
|
lines.push(` - job: ${module.jobId}_test`);
|
|
@@ -217,31 +217,34 @@ function appendGlobalReleaseJob(lines, modules) {
|
|
|
217
217
|
lines.push("");
|
|
218
218
|
for (const module of modules) {
|
|
219
219
|
lines.push(` echo "Tagging release for ${module.moduleName} (${module.modulePath})"`);
|
|
220
|
-
lines.push(` if [
|
|
221
|
-
lines.push(`
|
|
222
|
-
lines.push("
|
|
223
|
-
lines.push("
|
|
224
|
-
lines.push(
|
|
225
|
-
lines.push("
|
|
226
|
-
lines.push("
|
|
227
|
-
lines.push(`
|
|
228
|
-
lines.push("
|
|
220
|
+
lines.push(` if [ -f "${module.modulePath}/semalease.env" ]; then`);
|
|
221
|
+
lines.push(` . "${module.modulePath}/semalease.env"`);
|
|
222
|
+
lines.push(" TAG_NAME=\"\"");
|
|
223
|
+
lines.push(" if [ \"$CI_COMMIT_BRANCH\" = \"main\" ]; then");
|
|
224
|
+
lines.push(" if [ \"${NEXT_VERSION:-}\" != \"${LATEST_VERSION:-}\" ]; then");
|
|
225
|
+
lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}"`);
|
|
226
|
+
lines.push(" else");
|
|
227
|
+
lines.push(` echo "Version did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
|
|
228
|
+
lines.push(" fi");
|
|
229
|
+
lines.push(" else");
|
|
230
|
+
lines.push(" if [ \"${NEXT_VERSION:-}\" != \"${LATEST_VERSION:-}\" ] || [ \"${NEXT_INCREMENT:-}\" != \"${LATEST_INCREMENT:-}\" ]; then");
|
|
231
|
+
lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}-\${CI_COMMIT_BRANCH}-\${NEXT_INCREMENT}"`);
|
|
232
|
+
lines.push(" else");
|
|
233
|
+
lines.push(` echo "Version/increment did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
|
|
234
|
+
lines.push(" fi");
|
|
229
235
|
lines.push(" fi");
|
|
230
|
-
lines.push(
|
|
231
|
-
lines.push(" else");
|
|
232
|
-
lines.push(" if [ \"${NEXT_VERSION:-}\" = \"${LATEST_VERSION:-}\" ] && [ \"${NEXT_INCREMENT:-}\" = \"${LATEST_INCREMENT:-}\" ]; then");
|
|
233
|
-
lines.push(` echo "Version/increment did not change for ${module.moduleName} on branch $CI_COMMIT_BRANCH, skipping tag"`);
|
|
234
|
-
lines.push(" continue");
|
|
235
|
-
lines.push(" fi");
|
|
236
|
-
lines.push(` TAG_NAME="${module.moduleName}-v\${NEXT_VERSION}-\${CI_COMMIT_BRANCH}-\${NEXT_INCREMENT}"`);
|
|
237
|
-
lines.push(" fi");
|
|
236
|
+
lines.push(" if [ \"$TAG_NAME\" != \"\" ]; then");
|
|
238
237
|
if (module.moduleType === "node-express") {
|
|
239
|
-
lines.push(`
|
|
238
|
+
lines.push(` git add "${module.modulePath}/package.json"`);
|
|
240
239
|
}
|
|
241
240
|
else if (module.moduleType === "node-vite") {
|
|
242
|
-
lines.push(`
|
|
241
|
+
lines.push(` git add "${module.modulePath}/package.json" "${module.modulePath}/public/release.json"`);
|
|
243
242
|
}
|
|
244
|
-
lines.push("
|
|
243
|
+
lines.push(" git tag \"$TAG_NAME\"");
|
|
244
|
+
lines.push(" fi");
|
|
245
|
+
lines.push(" else");
|
|
246
|
+
lines.push(` echo "Missing ${module.modulePath}/semalease.env, skipping ${module.moduleName}"`);
|
|
247
|
+
lines.push(" fi");
|
|
245
248
|
}
|
|
246
249
|
lines.push("");
|
|
247
250
|
lines.push(" git commit -m \"release: update affected modules\"");
|
|
@@ -260,8 +263,8 @@ function appendModulePublishJob(lines, module, branchRule) {
|
|
|
260
263
|
lines.push(`${module.jobId}_publish:`);
|
|
261
264
|
lines.push(" stage: publish");
|
|
262
265
|
lines.push(" rules:");
|
|
263
|
-
lines.push("
|
|
264
|
-
lines.push(`
|
|
266
|
+
lines.push(" - changes:");
|
|
267
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
265
268
|
lines.push(" needs:");
|
|
266
269
|
lines.push(` - job: ${module.jobId}_test`);
|
|
267
270
|
lines.push(" - job: release_and_tag");
|
|
@@ -288,8 +291,8 @@ function appendModuleDeployJob(lines, module, branchRule) {
|
|
|
288
291
|
lines.push(`${module.jobId}_deploy:`);
|
|
289
292
|
lines.push(" stage: deploy");
|
|
290
293
|
lines.push(" rules:");
|
|
291
|
-
lines.push("
|
|
292
|
-
lines.push(`
|
|
294
|
+
lines.push(" - changes:");
|
|
295
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
293
296
|
lines.push(" needs:");
|
|
294
297
|
lines.push(` - job: ${module.jobId}_publish`);
|
|
295
298
|
lines.push(" image: $IMAGE_COMPOSE");
|