polyci 0.0.2 → 0.0.4
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 +20 -18
- package/package.json +8 -3
package/dist/main.js
CHANGED
|
@@ -91,13 +91,13 @@ function discoverModules(repoRoot, modulesRoot) {
|
|
|
91
91
|
}
|
|
92
92
|
function appendGlobalVariables(lines) {
|
|
93
93
|
lines.push("variables:");
|
|
94
|
-
lines.push(" IMAGE_LINUX: alpine:latest
|
|
95
|
-
lines.push(" IMAGE_NODE: node:alpine
|
|
94
|
+
lines.push(" IMAGE_LINUX: alpine:latest");
|
|
95
|
+
lines.push(" IMAGE_NODE: node:alpine");
|
|
96
96
|
lines.push(" IMAGE_GIT: alpine/git:latest");
|
|
97
|
-
lines.push(" IMAGE_NGINX: nginx:alpine-slim
|
|
98
|
-
lines.push(" IMAGE_DOCKER: docker:latest
|
|
97
|
+
lines.push(" IMAGE_NGINX: nginx:alpine-slim");
|
|
98
|
+
lines.push(" IMAGE_DOCKER: docker:latest");
|
|
99
99
|
lines.push(" IMAGE_COMPOSE: docker:cli");
|
|
100
|
-
lines.push(" GIT_PACKAGE: git
|
|
100
|
+
lines.push(" GIT_PACKAGE: git");
|
|
101
101
|
lines.push("");
|
|
102
102
|
lines.push("stages:");
|
|
103
103
|
lines.push(" - build");
|
|
@@ -107,18 +107,12 @@ function appendGlobalVariables(lines) {
|
|
|
107
107
|
lines.push(" - deploy");
|
|
108
108
|
lines.push("");
|
|
109
109
|
}
|
|
110
|
-
function appendRulesForModule(lines, modulePath, branchRule) {
|
|
111
|
-
lines.push(" rules:");
|
|
112
|
-
lines.push(" - if: $CI_COMMIT_MESSAGE =~ /^release:/");
|
|
113
|
-
lines.push(" when: never");
|
|
114
|
-
lines.push(` - if: $CI_COMMIT_BRANCH =~ ${branchRule}`);
|
|
115
|
-
lines.push(" changes:");
|
|
116
|
-
lines.push(` - ${modulePath}/**/*`);
|
|
117
|
-
}
|
|
118
110
|
function appendModuleBuildJob(lines, module, branchRule) {
|
|
119
111
|
lines.push(`${module.jobId}_build:`);
|
|
120
112
|
lines.push(" stage: build");
|
|
121
|
-
|
|
113
|
+
lines.push(" rules:");
|
|
114
|
+
lines.push(" - changes:");
|
|
115
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
122
116
|
lines.push(" image: $IMAGE_NODE");
|
|
123
117
|
lines.push(" variables:");
|
|
124
118
|
lines.push(` MODULE_NAME: ${module.moduleName}`);
|
|
@@ -137,7 +131,9 @@ function appendModuleBuildJob(lines, module, branchRule) {
|
|
|
137
131
|
function appendModuleTestJob(lines, module, branchRule) {
|
|
138
132
|
lines.push(`${module.jobId}_test:`);
|
|
139
133
|
lines.push(" stage: test");
|
|
140
|
-
|
|
134
|
+
lines.push(" rules:");
|
|
135
|
+
lines.push(" - changes:");
|
|
136
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
141
137
|
lines.push(" needs:");
|
|
142
138
|
lines.push(` - job: ${module.jobId}_build`);
|
|
143
139
|
lines.push(" image: $IMAGE_LINUX");
|
|
@@ -153,7 +149,9 @@ function appendModuleTestJob(lines, module, branchRule) {
|
|
|
153
149
|
function appendModuleReleaseJob(lines, module, branchRule) {
|
|
154
150
|
lines.push(`${module.jobId}_release:`);
|
|
155
151
|
lines.push(" stage: release");
|
|
156
|
-
|
|
152
|
+
lines.push(" rules:");
|
|
153
|
+
lines.push(" - changes:");
|
|
154
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
157
155
|
lines.push(" needs:");
|
|
158
156
|
lines.push(` - job: ${module.jobId}_build`);
|
|
159
157
|
lines.push(` - job: ${module.jobId}_test`);
|
|
@@ -261,7 +259,9 @@ function appendGlobalReleaseJob(lines, modules) {
|
|
|
261
259
|
function appendModulePublishJob(lines, module, branchRule) {
|
|
262
260
|
lines.push(`${module.jobId}_publish:`);
|
|
263
261
|
lines.push(" stage: publish");
|
|
264
|
-
|
|
262
|
+
lines.push(" rules:");
|
|
263
|
+
lines.push(" - changes:");
|
|
264
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
265
265
|
lines.push(" needs:");
|
|
266
266
|
lines.push(` - job: ${module.jobId}_test`);
|
|
267
267
|
lines.push(" - job: release_and_tag");
|
|
@@ -287,7 +287,9 @@ function appendModulePublishJob(lines, module, branchRule) {
|
|
|
287
287
|
function appendModuleDeployJob(lines, module, branchRule) {
|
|
288
288
|
lines.push(`${module.jobId}_deploy:`);
|
|
289
289
|
lines.push(" stage: deploy");
|
|
290
|
-
|
|
290
|
+
lines.push(" rules:");
|
|
291
|
+
lines.push(" - changes:");
|
|
292
|
+
lines.push(` - ${module.modulePath}/**/*`);
|
|
291
293
|
lines.push(" needs:");
|
|
292
294
|
lines.push(` - job: ${module.jobId}_publish`);
|
|
293
295
|
lines.push(" image: $IMAGE_COMPOSE");
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polyci",
|
|
3
3
|
"description": "Monorepo CI/CD utilities.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "Alexander Tsarev",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"main": "./dist/main.js",
|
|
10
|
-
"bin":
|
|
11
|
-
|
|
10
|
+
"bin": {
|
|
11
|
+
"polyci": "dist/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"readme.md"
|
|
16
|
+
],
|
|
12
17
|
"publishConfig": {
|
|
13
18
|
"access": "public"
|
|
14
19
|
},
|