aboutsummaryrefslogtreecommitdiff
path: root/guix/forge/forge.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/forge/forge.scm')
-rw-r--r--guix/forge/forge.scm30
1 files changed, 27 insertions, 3 deletions
diff --git a/guix/forge/forge.scm b/guix/forge/forge.scm
index abd8a26..09f92c9 100644
--- a/guix/forge/forge.scm
+++ b/guix/forge/forge.scm
@@ -47,6 +47,7 @@
#:export (forge-service-type
forge-configuration
forge-configuration?
+ forge-configuration-web-domain
forge-configuration-projects
forge-project
forge-project?
@@ -57,6 +58,7 @@
forge-project-repository-branch
forge-project-web-domain
forge-project-website-directory
+ forge-project-tissue?
forge-project-ci-jobs
forge-project-ci-jobs-trigger
forge-project-parallel-ci-job-runs
@@ -85,6 +87,8 @@
(default #f))
(website-directory forge-project-website-directory
(default #f))
+ (tissue? forge-project-tissue?
+ (default #f))
(ci-jobs forge-project-ci-jobs
(default '()) (thunked))
(ci-jobs-trigger forge-project-ci-jobs-trigger ; one of 'post-receive-hook, 'cron, 'webhook
@@ -101,6 +105,7 @@
(define-record-type* <forge-configuration>
forge-configuration make-forge-configuration
forge-configuration?
+ (web-domain forge-configuration-web-domain)
(projects forge-configuration-projects
(default '())))
@@ -447,16 +452,34 @@ that were built."
"Return list of @code{<nginx-server-configuration>} extensions for
forge configuration @var{config}."
;; Configure nginx server blocks for projects that have a web domain
- ;; and a website directory.
+ ;; and a website directory, but do not have tissue enabled.
(filter-map (match-record-lambda <forge-project>
(web-domain website-directory tissue?)
(and web-domain
website-directory
+ (not tissue?)
(nginx-server-configuration
(server-name (list web-domain))
(root website-directory))))
(forge-configuration-projects config)))
+(define (forge-tissue-host config)
+ "Return @code{<tissue-host>} object for forge configuration
+@var{config}."
+ (tissue-host
+ (name (forge-configuration-web-domain config))
+ (projects
+ (filter-map (lambda (project)
+ (and (forge-project-tissue? project)
+ (tissue-project
+ (name (forge-project-name project))
+ ;; The laminar user must own the host state so
+ ;; that it can run tissue pull.
+ (user "laminar")
+ (upstream-repository
+ (forge-project-repository project)))))
+ (forge-configuration-projects config)))))
+
(define (forge-ci-jobs config)
"Return list of CI jobs for forge configuration @var{config}. Each
value of the returned list is a @code{<forge-laminar-job>} object."
@@ -548,6 +571,8 @@ value is a list of @code{<webhook-hook>} objects."
forge-activation)
(service-extension forge-nginx-service-type
forge-nginx-server-blocks)
+ (service-extension tissue-service-type
+ (compose list forge-tissue-host))
(service-extension forge-laminar-service-type
forge-ci-jobs+contexts+groups)
;; TODO: Run CI job only if there are new commits
@@ -561,5 +586,4 @@ value is a list of @code{<webhook-hook>} objects."
(forge-configuration
(inherit config)
(projects (append (forge-configuration-projects config)
- projects)))))
- (default-value (forge-configuration))))
+ projects)))))))