polyci 0.1.0 → 0.1.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +47 -10
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "polyci",
3
3
  "description": "Monorepo CI/CD utilities.",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "author": "Alexander Tsarev",
package/readme.md CHANGED
@@ -1,13 +1,50 @@
1
- installation
1
+ # polyci
2
2
 
3
- usage
3
+ Generates GitLab CI pipelines for monorepos. Discovers modules under a root directory, creates per-module build, test, release, publish, and deploy jobs, and wires them with conventional-commit-based versioning via semalease.
4
4
 
5
- recommedations
6
- do not change the provided module types and scripts. instead, copy and customise your own type.
7
- be careful changin environment in release.sh (eg install packages) as the module releases run in one job in one container.
5
+ ## Installation
8
6
 
9
- requirements
10
- POLYCI_TOKEN variable must be defined in GitLab and accessible in the jobs that match the rule in the root .gitlab-ci.yml.
11
- each module must have build script to be called via "npm run build".
12
- each module must put the build result into ./dist folder.
13
- docker service deploy needs docker host server with traefik 3.
7
+ ```bash
8
+ npm install
9
+ npm run build
10
+ ```
11
+
12
+ Or use via `npx polyci` when the package is published.
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ npx polyci [output] [options]
18
+ ```
19
+
20
+ **Example** (typical GitLab CI setup):
21
+
22
+ ```bash
23
+ npx polyci --modules-root modules polyci-pipeline.yml
24
+ ```
25
+
26
+ **Options:**
27
+
28
+ | Option | Description | Default |
29
+ |--------|-------------|---------|
30
+ | `-o, --output <path>` | Output pipeline file path | — |
31
+ | `--modules-root <path>` | Root directory to scan for modules | `./modules` |
32
+ | `--main-branch <name>` | Primary branch for release tagging | `main` |
33
+ | `--version-template <template>` | Version template for main branch; placeholders: `{version}`, `{branch}`, `{increment}` | `{version}` |
34
+ | `--branch-version-template <template>` | Version template for non-main branches | `{version}-{branch}-{increment}` |
35
+ | `--tag-template <template>` | Tag template; placeholders: `{module}`, `{version}` | `{module}-v{version}` |
36
+ | `--tag-pattern <pattern>` | Tag regex for main branch (passed to semalease) | `^$PLI_MODULE_NAME-v(?<version>...)` |
37
+ | `--branch-tag-pattern <pattern>` | Tag regex for non-main branches (with `?<increment>`) | — |
38
+ | `--cwd <path>` | Working directory | current directory |
39
+
40
+ ## Requirements
41
+
42
+ - **POLYCI_TOKEN** — GitLab OAuth token for pushing tags; must be defined in GitLab CI/CD variables and available to jobs that run the release stage.
43
+ - **Module build** — Each module must support `npm run build` and produce output in `./dist`.
44
+
45
+ For **docker-service** deploy type: a Docker host with Traefik 3.
46
+
47
+ ## Recommendations
48
+
49
+ - **Do not modify the built-in module types** (`node-vite`, `node-express`, `npm-package`). Copy and customize a new type under `ci/` instead.
50
+ - **Avoid heavy setup in `release.sh`** — Module releases run sequentially in a single container; installing extra packages or changing the environment can slow or break the job.