@andrian.yablonskyy/thub-agent 1.0.24 → 1.0.25

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 CHANGED
@@ -55,6 +55,7 @@ Key options for `thub run`:
55
55
  | `--docker-image <name>` | SW only: a Docker image the Client runs as the DUT instead of its own `sw.image` (the Client must allow it: `sw.allowJobImages`). |
56
56
  | `--git-repo <url> [<branch>\|<tag>\|<commit>]` | A git repository the Client clones (default ref: the default branch); the command runs in the checkout. |
57
57
  | `--depth <n>` | With `--git-repo`: commits to fetch, default `1`; `0` = full history. |
58
+ | `--git-options <string>` | With `--git-repo`: extra git options placed between `git` and its subcommand on the Client, e.g. `'-c core.sshCommand="ssh -i ~/.ssh/lab_key -p 2222"'`. Shell-quoted (no shell run). Stored with the job, so reference key files rather than inlining secrets. |
58
59
  | `--suite <name>` | Passed to the command as `THUB_SUITE`. |
59
60
  | `--arg <value>` | Extra argument for the command, as `"$@"` (repeatable). |
60
61
  | `--timeout <dur>` | e.g. `30m`, default `30m`. |
package/README.pdf CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrian.yablonskyy/thub-agent",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "TestHub Agent CLI — the single entry point CI/CD and developers use to submit and follow test jobs",
5
5
  "bin": {
6
6
  "thub": "./src/cli.js"
package/src/cli.js CHANGED
@@ -17,7 +17,8 @@
17
17
 
18
18
  const { Command } = require('commander'),
19
19
  {
20
- ApiClient, EXIT_CODES, ACTIVE_JOB_STATES, exitCodeForJobState, PACKAGES, fetchLatestVersion, isNewer, isValidVersion, formatDateTime
20
+ ApiClient, EXIT_CODES, ACTIVE_JOB_STATES, exitCodeForJobState, PACKAGES, fetchLatestVersion, isNewer, isValidVersion, formatDateTime,
21
+ splitArgs
21
22
  } = require('@andrian.yablonskyy/thub-common'),
22
23
  { resolveConnection, resolveGroup, resolveUser, writeConfigFile, readConfigFile } = require('./config'),
23
24
  { parseDurationSec } = require('./duration'),
@@ -76,6 +77,17 @@ function taskFromOptions(opts){
76
77
  if (opts.depth !== undefined && !opts.gitRepo){
77
78
  throw usageError('--depth only applies to --git-repo');
78
79
  }
80
+ if (opts.gitOptions !== undefined && !opts.gitRepo){
81
+ throw usageError('--git-options only applies to --git-repo');
82
+ }
83
+ if (opts.gitOptions){
84
+ try {
85
+ splitArgs(opts.gitOptions);
86
+ }
87
+ catch (err){
88
+ throw usageError(`--git-options: ${err.message}`);
89
+ }
90
+ }
79
91
  if (opts.gitRepo){
80
92
  const [url, ref, ...extra] = opts.gitRepo;
81
93
  if (extra.length){
@@ -85,7 +97,7 @@ function taskFromOptions(opts){
85
97
  if (!Number.isInteger(depth) || depth < 0){
86
98
  throw usageError(`--depth ${opts.depth}: must be a whole number (0 = full history)`);
87
99
  }
88
- task.git = { url, ...(ref ? { ref } : {}), depth };
100
+ task.git = { url, ...(ref ? { ref } : {}), depth, ...(opts.gitOptions ? { options: opts.gitOptions } : {}) };
89
101
  }
90
102
  return task;
91
103
  }
@@ -143,6 +155,11 @@ program
143
155
  '(https://, ssh://, git:// or user@host:path; default ref: the default branch)'
144
156
  )
145
157
  .option('--depth <n>', 'With --git-repo: how many commits to fetch (default 1; 0 = full history)')
158
+ .option(
159
+ '--git-options <string>',
160
+ 'With --git-repo: extra git options, placed between `git` and its subcommand on the Client (shell-quoted, no shell run), ' +
161
+ 'e.g. \'-c core.sshCommand="ssh -i ~/.ssh/lab_key -p 2222"\'. Stored with the job — reference key files, don\'t inline secrets'
162
+ )
146
163
  .option('--suite <name>', 'Test suite name, passed to --command as THUB_SUITE', 'default')
147
164
  .option('--arg <value>', 'Extra argument for --command, as "$@" (repeatable)', collectRepeatable, [])
148
165
  .option('--timeout <duration>', 'e.g. 30m, 1h', '30m')