@r5n/hydra 0.11.3 → 0.13.0
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 +10 -9
- package/dist/cli.js +252 -93
- package/package.json +1 -1
- package/schema.json +100 -8
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$comment": "Add this to your
|
|
2
|
+
"$comment": "Add this to config.json in your Hydra home (~/.hydra by default): \"$schema\": \"https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/hydra/schema.json\"",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"additionalProperties": false,
|
|
5
5
|
"definitions": {
|
|
@@ -37,16 +37,107 @@
|
|
|
37
37
|
},
|
|
38
38
|
"type": "object"
|
|
39
39
|
},
|
|
40
|
+
"credentials": {
|
|
41
|
+
"description": "How Hydra authenticates to the GitHub API; the gh login when absent",
|
|
42
|
+
"oneOf": [
|
|
43
|
+
{
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"properties": {
|
|
46
|
+
"mode": { "const": "gh", "description": "Use the operator's gh login (gh auth token)", "type": "string" }
|
|
47
|
+
},
|
|
48
|
+
"required": ["mode"],
|
|
49
|
+
"type": "object"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"appId": { "description": "The GitHub App's id", "minimum": 1, "type": "integer" },
|
|
55
|
+
"installationId": {
|
|
56
|
+
"description": "The id of the App's installation on the organisation or repository",
|
|
57
|
+
"minimum": 1,
|
|
58
|
+
"type": "integer"
|
|
59
|
+
},
|
|
60
|
+
"mode": { "const": "app", "description": "Mint installation tokens as a GitHub App", "type": "string" },
|
|
61
|
+
"privateKeyPath": {
|
|
62
|
+
"description": "Absolute path to the App's PEM private key, owned by the user running Hydra with mode 0600",
|
|
63
|
+
"minLength": 1,
|
|
64
|
+
"pattern": "^/",
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": ["mode", "appId", "installationId", "privateKeyPath"],
|
|
69
|
+
"type": "object"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
40
73
|
"profile": {
|
|
41
74
|
"additionalProperties": false,
|
|
42
75
|
"properties": {
|
|
43
76
|
"directory": {
|
|
44
|
-
"
|
|
45
|
-
"
|
|
77
|
+
"description": "Directory where runners will be created; hydra init writes runners/ in the Hydra home. A relative path resolves against the home, or against the directory that holds it when the home is named .hydra",
|
|
78
|
+
"minLength": 1,
|
|
46
79
|
"type": "string"
|
|
47
80
|
},
|
|
81
|
+
"jobHooks": {
|
|
82
|
+
"additionalProperties": false,
|
|
83
|
+
"description": "Scripts Hydra installs as each runner's job hooks; hydra create and hydra update write them",
|
|
84
|
+
"properties": {
|
|
85
|
+
"dns": {
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"description": "Job-started hook that waits for DNS before every job and fails the job if it does not recover",
|
|
88
|
+
"properties": {
|
|
89
|
+
"enabled": { "default": true, "description": "Install the DNS wait hook", "type": "boolean" },
|
|
90
|
+
"hosts": {
|
|
91
|
+
"default": [
|
|
92
|
+
"github.com",
|
|
93
|
+
"api.github.com",
|
|
94
|
+
"objects.githubusercontent.com",
|
|
95
|
+
"pipelines.actions.githubusercontent.com"
|
|
96
|
+
],
|
|
97
|
+
"description": "Hosts that must all resolve before the job starts",
|
|
98
|
+
"items": {
|
|
99
|
+
"format": "hostname",
|
|
100
|
+
"pattern": "^[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$",
|
|
101
|
+
"type": "string"
|
|
102
|
+
},
|
|
103
|
+
"minItems": 1,
|
|
104
|
+
"type": "array"
|
|
105
|
+
},
|
|
106
|
+
"timeoutSeconds": {
|
|
107
|
+
"default": 120,
|
|
108
|
+
"description": "Seconds to wait for DNS before failing the job",
|
|
109
|
+
"minimum": 1,
|
|
110
|
+
"type": "integer"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"type": "object"
|
|
114
|
+
},
|
|
115
|
+
"workspaceCleanup": {
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"description": "Job-completed hook that removes the job's workspace and _temp contents from the runner's _work directory",
|
|
118
|
+
"properties": {
|
|
119
|
+
"enabled": {
|
|
120
|
+
"default": false,
|
|
121
|
+
"description": "Install the cleanup hook; hydra init turns it on for new profiles",
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"keepToolCache": {
|
|
125
|
+
"default": true,
|
|
126
|
+
"description": "Keep _work/_tool; set to false to empty the tool cache after every job as well",
|
|
127
|
+
"type": "boolean"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"type": "object"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"type": "object"
|
|
134
|
+
},
|
|
48
135
|
"labels": { "description": "Comma-separated list of labels for the runners", "type": "string" },
|
|
49
|
-
"name": {
|
|
136
|
+
"name": {
|
|
137
|
+
"description": "Base name for the runners; hydra init uses runner unless --name is given",
|
|
138
|
+
"minLength": 1,
|
|
139
|
+
"type": "string"
|
|
140
|
+
},
|
|
50
141
|
"numberOfMachines": {
|
|
51
142
|
"default": 1,
|
|
52
143
|
"description": "Number of runner machines to create",
|
|
@@ -54,15 +145,13 @@
|
|
|
54
145
|
"type": "integer"
|
|
55
146
|
},
|
|
56
147
|
"os": {
|
|
57
|
-
"
|
|
58
|
-
"description": "Operating system for the runners",
|
|
148
|
+
"description": "Operating system for the runners; hydra init detects it from the host",
|
|
59
149
|
"enum": ["osx", "linux", "windows"],
|
|
60
150
|
"type": "string"
|
|
61
151
|
},
|
|
62
152
|
"overwrite": { "default": false, "description": "Whether to overwrite existing runners", "type": "boolean" },
|
|
63
153
|
"provider": {
|
|
64
|
-
"
|
|
65
|
-
"description": "Runner provider backing this profile",
|
|
154
|
+
"description": "Runner provider backing this profile; hydra init writes github",
|
|
66
155
|
"enum": ["github", "gitlab"],
|
|
67
156
|
"type": "string"
|
|
68
157
|
},
|
|
@@ -78,9 +167,11 @@
|
|
|
78
167
|
"url": {
|
|
79
168
|
"description": "GitHub repository URL (https://github.com/<owner>/<repo>) or organization URL (https://github.com/<org>)",
|
|
80
169
|
"format": "uri",
|
|
170
|
+
"minLength": 1,
|
|
81
171
|
"type": "string"
|
|
82
172
|
}
|
|
83
173
|
},
|
|
174
|
+
"required": ["url", "name", "directory", "os", "provider"],
|
|
84
175
|
"type": "object"
|
|
85
176
|
},
|
|
86
177
|
"runnerEntry": {
|
|
@@ -109,6 +200,7 @@
|
|
|
109
200
|
"$ref": "#/definitions/cleanup",
|
|
110
201
|
"description": "Disk cleanup behavior for hydra cleanup and automatic cleanup"
|
|
111
202
|
},
|
|
203
|
+
"credentials": { "$ref": "#/definitions/credentials" },
|
|
112
204
|
"defaultProfile": { "description": "The default profile to use when no profile is specified", "type": "string" },
|
|
113
205
|
"profiles": {
|
|
114
206
|
"additionalProperties": { "$ref": "#/definitions/profile" },
|