diff options
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) |