summaryrefslogtreecommitdiff
path: root/model/job.ts
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2025-05-12 09:40:12 -0700
committerElizabeth <me@liz.coffee>2025-05-26 14:15:42 -0700
commitd51c9d74857aca3c2f172609297266968bc7f809 (patch)
tree64327f9cc4219729aa11af32d7d4c70cddfc2292 /model/job.ts
parent30729a0cf707d9022bae0a7baaba77379dc31fd5 (diff)
downloadci-d51c9d74857aca3c2f172609297266968bc7f809.tar.gz
ci-d51c9d74857aca3c2f172609297266968bc7f809.zip
The big refactor TM
Diffstat (limited to 'model/job.ts')
-rw-r--r--model/job.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/model/job.ts b/model/job.ts
index 53d548f..a3b52dd 100644
--- a/model/job.ts
+++ b/model/job.ts
@@ -1,8 +1,13 @@
+import { isObject } from "@emprespresso/pengueno";
+
export type JobArgT = Record<string, string>;
export interface Job {
readonly type: string;
readonly arguments: JobArgT;
}
+export const isJob = (j: unknown): j is Job =>
+ !!(isObject(j) && "arguments" in j && isObject(j.arguments) &&
+ "type" in j && typeof j.type === "string" && j);
export interface FetchCodeJobProps extends JobArgT {
readonly remoteUrl: string;
@@ -40,3 +45,17 @@ export interface AnsiblePlaybookJob extends Job {
readonly type: "ansible_playbook";
readonly arguments: AnsiblePlaybookJobProps;
}
+
+export interface CheckoutCiJobProps extends JobArgT {
+ readonly remote: string;
+ readonly refname: string;
+ readonly rev: string;
+
+ readonly run: string;
+ readonly returnPath: string;
+}
+
+export interface CheckoutCiJob extends Job {
+ readonly type: "checkout_ci";
+ readonly arguments: CheckoutCiJobProps;
+}