services: cuirass: Allow passing extra command line options.

This is so that the options supported by the service configuration don't have
to always be changed. Generally though all options should be explicitly
supported and documented, so this is mostly to facilitate experimentation.

* gnu/services/cuirass.scm (<cuirass-configuration>): Add an extra-options
field.
(cuirass-shepherd-service): Pass the extra options to the shepherd servvices.
* doc/guix.texi (Continuous Integration): Document it.
This commit is contained in:
Christopher Baines 2020-03-02 08:00:14 +00:00
parent d8ab68b929
commit af96c1e0e4
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577
2 changed files with 12 additions and 4 deletions

View file

@ -22450,6 +22450,9 @@ Only evaluate specifications and build derivations once.
When substituting a pre-built binary fails, fall back to building
packages locally.
@item @code{extra-options} (default: @code{'()})
Extra options to pass when running the Cuirass processes.
@item @code{cuirass} (default: @code{cuirass})
The Cuirass package to use.
@end table

View file

@ -77,7 +77,9 @@ (define-record-type* <cuirass-configuration>
(one-shot? cuirass-configuration-one-shot? ;boolean
(default #f))
(fallback? cuirass-configuration-fallback? ;boolean
(default #f)))
(default #f))
(extra-options cuirass-configuration-extra-options
(default '())))
(define (cuirass-shepherd-service config)
"Return a <shepherd-service> for the Cuirass service with CONFIG."
@ -95,7 +97,8 @@ (define (cuirass-shepherd-service config)
(specs (cuirass-configuration-specifications config))
(use-substitutes? (cuirass-configuration-use-substitutes? config))
(one-shot? (cuirass-configuration-one-shot? config))
(fallback? (cuirass-configuration-fallback? config)))
(fallback? (cuirass-configuration-fallback? config))
(extra-options (cuirass-configuration-extra-options config)))
(list (shepherd-service
(documentation "Run Cuirass.")
(provision '(cuirass))
@ -110,7 +113,8 @@ (define (cuirass-shepherd-service config)
"--interval" #$(number->string interval)
#$@(if use-substitutes? '("--use-substitutes") '())
#$@(if one-shot? '("--one-shot") '())
#$@(if fallback? '("--fallback") '()))
#$@(if fallback? '("--fallback") '())
#$@extra-options)
#:environment-variables
(list "GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
@ -137,7 +141,8 @@ (define (cuirass-shepherd-service config)
"--listen" #$host
"--interval" #$(number->string interval)
#$@(if use-substitutes? '("--use-substitutes") '())
#$@(if fallback? '("--fallback") '()))
#$@(if fallback? '("--fallback") '())
#$@extra-options)
#:user #$user
#:group #$group