@cloud-cli/on 1.2.2 → 1.2.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/README.md +24 -20
- package/dist/db-client.d.ts +14 -0
- package/dist/drivers/index.d.ts +2 -0
- package/dist/drivers/standard-process.driver.d.ts +10 -0
- package/dist/drivers/systemd.driver.d.ts +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/log-redactor.d.ts +6 -0
- package/dist/on.js +9240 -0
- package/dist/parser/include-resolver.d.ts +9 -0
- package/dist/parser/matrix-expander.d.ts +5 -0
- package/dist/parser/yaml-loader.d.ts +6 -0
- package/dist/plugins/github-status.plugin.d.ts +7 -0
- package/dist/plugins/manager.d.ts +7 -0
- package/dist/queue.d.ts +38 -0
- package/dist/reporters/html.reporter.d.ts +14 -0
- package/dist/reporters/json-file.reporter.d.ts +9 -0
- package/dist/reporters/slack.reporter.d.ts +15 -0
- package/dist/safe-eval.d.ts +28 -0
- package/dist/secrets.d.ts +15 -0
- package/dist/server/preprocessors/github.d.ts +5 -0
- package/dist/server/server.d.ts +32 -0
- package/dist/types.d.ts +181 -0
- package/dist/worker.d.ts +8 -0
- package/package.json +24 -20
- package/dist/config.js +0 -15
- package/dist/db-client.js +0 -38
- package/dist/drivers/index.js +0 -11
- package/dist/drivers/standard-process.driver.js +0 -156
- package/dist/drivers/systemd.driver.js +0 -151
- package/dist/evaluator/safe-eval.js +0 -213
- package/dist/index.js +0 -145
- package/dist/ingress/preprocessors/github.js +0 -30
- package/dist/ingress/server.js +0 -241
- package/dist/logging/redactor.js +0 -20
- package/dist/parser/include-resolver.js +0 -47
- package/dist/parser/matrix-expander.js +0 -43
- package/dist/parser/yaml-loader.js +0 -45
- package/dist/plugins/github-status.plugin.js +0 -19
- package/dist/plugins/manager.js +0 -21
- package/dist/plugins/types.js +0 -1
- package/dist/queue/dispatcher.js +0 -112
- package/dist/reporters/html.reporter.js +0 -108
- package/dist/reporters/json-file.reporter.js +0 -16
- package/dist/reporters/slack.reporter.js +0 -25
- package/dist/reporters/types.js +0 -1
- package/dist/runner/step-runner.js +0 -42
- package/dist/secrets/store.js +0 -40
- package/dist/types.js +0 -1
- package/dist/worker.js +0 -249
- /package/dist/{ingress/types.js → runner/step-runner.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -54,9 +54,10 @@ Secrets are automatically loaded from `.env` at the root of your project. Prefix
|
|
|
54
54
|
SECRET_NPM_TOKEN="npm_1234567890abcdef"
|
|
55
55
|
SECRET_GITHUB_TOKEN="ghp_1234567890abcdef"
|
|
56
56
|
SECRET_GITHUB_WEBHOOK_SECRET="my-webhook-secret"
|
|
57
|
-
|
|
58
57
|
```
|
|
59
58
|
|
|
59
|
+
`SECRET_GITHUB_WEBHOOK_SECRET` is required to validate incoming webhooks from GitHub
|
|
60
|
+
|
|
60
61
|
### 3. Define a Workflow (`.on/release.yml`)
|
|
61
62
|
|
|
62
63
|
```yaml
|
|
@@ -106,23 +107,26 @@ npx @cloud-cli/on [command] [options]
|
|
|
106
107
|
|
|
107
108
|
### Commands
|
|
108
109
|
|
|
109
|
-
| Command | Description
|
|
110
|
-
| ----------------------- |
|
|
111
|
-
| **`start`** _(default)_ | Runs both Webhook Ingress Gateway and Worker execution loops together.
|
|
112
|
-
| **`start-server`** | Runs Webhook Ingress Gateway only (API / Gateway mode).
|
|
113
|
-
| **`start-workers`** | Runs Worker Polling loops only (Scalable Worker mode).
|
|
114
|
-
| **`validate`** | Parses and validates all YAML workflows in
|
|
110
|
+
| Command | Description |
|
|
111
|
+
| ----------------------- | ---------------------------------------------------------------------------------------- |
|
|
112
|
+
| **`start`** _(default)_ | Runs both Webhook Ingress Gateway and Worker execution loops together. |
|
|
113
|
+
| **`start-server`** | Runs Webhook Ingress Gateway only (API / Gateway mode). |
|
|
114
|
+
| **`start-workers`** | Runs Worker Polling loops only (Scalable Worker mode). |
|
|
115
|
+
| **`validate`** | Parses and validates all YAML workflows in your workflows folder without executing jobs. |
|
|
116
|
+
|
|
117
|
+
### CLI and Environment Options
|
|
115
118
|
|
|
116
|
-
|
|
119
|
+
| Flag | Option | Default | Env | Description |
|
|
120
|
+
| ---- | ------------- | --------------------- | --------------------- | ----------------------------------------- |
|
|
121
|
+
| `-h` | `--help` | — | - | Prints CLI help message and exits. |
|
|
122
|
+
| `-c` | `--config` | `./runner.config.mjs` | `RUNNER_CONFIG_FILE` | Path to JavaScript configuration file. |
|
|
123
|
+
| `-d` | `--database` | - | `RUNNER_DATABASE_URL` | SQLite database file path or HTTP URL. |
|
|
124
|
+
| `-w` | `--workflows` | `.on/` | `RUNNER_WORKFLOWS` | Directory where workflow YAML files live. |
|
|
125
|
+
| `-p` | `--port` | `11235` | `PORT` | Port for the Ingress HTTP server. |
|
|
126
|
+
| `-k` | `--workers` | `5` | `RUNNER_WORKERS` | Number of worker loop threads to spawn. |
|
|
127
|
+
| | | | `RUNNER_ADMIN_SECRET` | Admin token to refresh secrets via API |
|
|
117
128
|
|
|
118
|
-
|
|
119
|
-
| ---- | ------------- | -------------------------- | ----------------------------------------- |
|
|
120
|
-
| `-c` | `--config` | `./runner.config.mjs` | Path to JavaScript configuration file. |
|
|
121
|
-
| `-d` | `--database` | `process.env.DATABASE_URL` | SQLite database file path or HTTP URL. |
|
|
122
|
-
| `-w` | `--workflows` | `.on/` | Directory where workflow YAML files live. |
|
|
123
|
-
| `-p` | `--port` | `3000` | Port for the Ingress HTTP server. |
|
|
124
|
-
| `-k` | `--workers` | `5` | Number of worker loop threads to spawn. |
|
|
125
|
-
| `-h` | `--help` | — | Prints CLI help message and exits. |
|
|
129
|
+
### Secrets
|
|
126
130
|
|
|
127
131
|
---
|
|
128
132
|
|
|
@@ -136,10 +140,10 @@ import { HtmlReporter, SlackReporter, JsonFileReporter } from '@cloud-cli/on/rep
|
|
|
136
140
|
|
|
137
141
|
export default {
|
|
138
142
|
port: 3000,
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
workers: 5,
|
|
144
|
+
workflows: '/home/workflows/',
|
|
141
145
|
storagePath: '/tmp/workspaces',
|
|
142
|
-
|
|
146
|
+
database: 'https://remote.db.com/',
|
|
143
147
|
|
|
144
148
|
// Global environment variables passed to all steps
|
|
145
149
|
env: {
|
|
@@ -194,7 +198,7 @@ Within `${...}`, `if:`, and `eval:` contexts, the following object scopes are ex
|
|
|
194
198
|
|
|
195
199
|
- **`inputs`**: Payload key-values received from incoming webhooks.
|
|
196
200
|
- **`env`**: Merged environment variables from global config and workflow definitions.
|
|
197
|
-
- **`secrets`**: Unmasked secret values loaded from `.env` (`SECRET_` prefix stripped).
|
|
201
|
+
- **`secrets`**: Unmasked secret values loaded from `.env` or environment variables (`SECRET_` prefix stripped).
|
|
198
202
|
- **`steps`**: Execution statuses and outputs from previous steps in the workflow (`steps.<id>.status`, `steps.<id>.outputs`).
|
|
199
203
|
- **`BUILTIN_HELPERS`**: JS utilities including `String`, `Number`, `Boolean`, and `JSON.parse` / `JSON.stringify`.
|
|
200
204
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function query(method: 'get' | 'run' | 'all', statement: string, data?: Array<string | number | null>, pragma?: string[]): Promise<any>;
|
|
2
|
+
export declare const get: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
3
|
+
export declare const run: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
4
|
+
export declare const all: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
5
|
+
export declare function pragma(p: any): void;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
query: typeof query;
|
|
8
|
+
get: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
9
|
+
run: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
10
|
+
all: (statement: string, data?: (string | number | null)[] | undefined, pragma?: string[] | undefined) => Promise<any>;
|
|
11
|
+
pragma: typeof pragma;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
export declare function setUrl(u: any): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExecutionDriver, StepContext, StepExecutionHandle } from '../types.js';
|
|
2
|
+
export declare class StandardProcessDriver implements ExecutionDriver {
|
|
3
|
+
name: string;
|
|
4
|
+
isSupported(): Promise<boolean>;
|
|
5
|
+
execute(ctx: StepContext): Promise<StepExecutionHandle>;
|
|
6
|
+
/**
|
|
7
|
+
* Kills the entire process group tree (-PID) with unref escalation
|
|
8
|
+
*/
|
|
9
|
+
private killProcessGroup;
|
|
10
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Transform, TransformCallback } from 'node:stream';
|
|
2
|
+
export declare class SecretRedactorStream extends Transform {
|
|
3
|
+
private secretValues;
|
|
4
|
+
constructor(secretValues: string[]);
|
|
5
|
+
_transform(chunk: any, _encoding: BufferEncoding, callback: TransformCallback): void;
|
|
6
|
+
}
|