diff options
author | Arun Isaac | 2024-01-09 15:45:30 +0000 |
---|---|---|
committer | Arun Isaac | 2024-01-09 17:14:10 +0000 |
commit | 51e10bab897a98b28ecb7a3ea73640015522b4d5 (patch) | |
tree | 5b505a4aad5ae5a212ac60597e0a0a3f710a7774 /guix | |
parent | 3c9d767f196f34e69a449e4f3cf920d9e6508f77 (diff) | |
download | guix-forge-51e10bab897a98b28ecb7a3ea73640015522b4d5.tar.gz guix-forge-51e10bab897a98b28ecb7a3ea73640015522b4d5.tar.lz guix-forge-51e10bab897a98b28ecb7a3ea73640015522b4d5.zip |
laminar: Allow associating contexts to jobs.
* guix/forge/laminar.scm (<forge-laminar-job>)[contexts]: New field.
* guix/forge/laminar.scm (laminar-jobs): Create job configuration file
specifying contexts.
* doc/forge.skb (Reference)[<forge-laminar-job>]{contexts}: Document
it.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/forge/laminar.scm | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/guix/forge/laminar.scm b/guix/forge/laminar.scm index cc6b260..16f5de7 100644 --- a/guix/forge/laminar.scm +++ b/guix/forge/laminar.scm @@ -23,6 +23,7 @@ #:use-module (gnu packages ci) #:use-module (gnu services ci) #:use-module (guix records) + #:use-module (ice-9 match) #:export (forge-laminar-service-type forge-laminar-configuration forge-laminar-configuration? @@ -37,6 +38,7 @@ forge-laminar-job-run forge-laminar-job-after forge-laminar-job-trigger? + forge-laminar-job-contexts forge-laminar-context forge-laminar-context? forge-laminar-context-name @@ -67,7 +69,9 @@ (after forge-laminar-job-after (default #f)) (trigger? forge-laminar-job-trigger? - (default #t))) + (default #t)) + (contexts forge-laminar-job-contexts + (default '()))) (define-record-type* <forge-laminar-context> forge-laminar-context make-forge-laminar-context @@ -112,17 +116,23 @@ list of @var{<forge-laminar-context>} objects." of @var{<forge-laminar-job>} objects." (file-union "laminar-jobs" (append-map (lambda (job) - (let ((name (forge-laminar-job-name job)) - (run (forge-laminar-job-run job)) - (after (forge-laminar-job-after job))) - (cons (let ((run-name (string-append name ".run"))) - (list run-name - (program-file run-name run))) + (let ((name (forge-laminar-job-name job))) + `(,(let ((run-name (string-append name ".run"))) + `(,run-name ,(program-file run-name + (forge-laminar-job-run job)))) + ,@(let ((after (forge-laminar-job-after job)) + (after-name (string-append name ".after"))) (if after - (list (let ((after-name (string-append name ".after"))) - (list after-name - (program-file after-name after)))) - (list))))) + `((,after-name ,(program-file after-name after))) + '())) + ,@(match (forge-laminar-job-contexts job) + (() '()) + (contexts + (let ((conf-name (string-append name ".conf"))) + `((,conf-name ,(mixed-text-file conf-name + "CONTEXTS=" + (string-join contexts ",") + "\n"))))))))) jobs))) (define (forge-laminar-activation config) |