services: cuirass: Improve simple-cuirass-services.
Instead of returning multiple services in simple-cuirass-services, rely on the instantiate-missing-services procedure to instantiate postgresql and postgresql-role-service-type when missing. Turn simple-cuirass-services procedure into simple-cuirass-configuration->specs, that takes a simple-cuirass-configuration record and returns a Cuirass specification. Suggested-by: Ludovic Courtès <ludo@gnu.org> * gnu/services/cuirass.scm (%default-cuirass-config): Remove it. (simple-cuirass-services): Rename it to ... (simple-cuirass-configuration->specs): ... this procedure. * gnu/tests/cuirass.scm (cuirass-services): Remove postgresql and postgresql-role services that are automatically instantiated. (simple-cuirass-service): New variable. (%cuirass-simple-test): Adapt it to use simple-cuirass-configuration->specs instead of simple-cuirass-services. * doc/guix.texi (Simple Cuirass): Update it.
This commit is contained in:
parent
602f86d60b
commit
bebcf97600
3 changed files with 55 additions and 60 deletions
|
@ -27145,11 +27145,15 @@ The Cuirass package to use.
|
||||||
@subsubheading Simple Cuirass
|
@subsubheading Simple Cuirass
|
||||||
|
|
||||||
The Cuirass service configuration described above can be a little
|
The Cuirass service configuration described above can be a little
|
||||||
intimidating. The @code{simple-cuirass-services} procedure offers a way
|
intimidating. In particular, getting the right @code{specifications}
|
||||||
to setup a continuous integration server more readily.
|
can prove difficult. The @code{simple-cuirass-configuration->specs}
|
||||||
|
procedure offers a way to generate those @code{specifications} and thus
|
||||||
|
setup a continuous integration server more readily.
|
||||||
|
|
||||||
It takes a @code{simple-cuirass-configuration} record as its first
|
@deffn {Scheme Procedure} simple-cuirass-configuration->specs @var{configuration}
|
||||||
argument.
|
This procedure takes a @code{simple-cuirass-configuration} record as
|
||||||
|
argument and returns the corresponding Cuirass specifications gexp.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
@deftp {Data Type} simple-cuirass-configuration
|
@deftp {Data Type} simple-cuirass-configuration
|
||||||
Data type representing the configuration of a simple Cuirass instance.
|
Data type representing the configuration of a simple Cuirass instance.
|
||||||
|
@ -27195,13 +27199,16 @@ is re-evaluated each time a commit is pushed in one of the declared
|
||||||
channels.
|
channels.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(simple-cuirass-services
|
(service cuirass-service-type
|
||||||
|
(cuirass-configuration
|
||||||
|
(specifications
|
||||||
|
(simple-cuirass-configuration->specs
|
||||||
(simple-cuirass-configuration
|
(simple-cuirass-configuration
|
||||||
(build 'all)
|
(build 'all)
|
||||||
(channels (cons (channel
|
(channels (cons (channel
|
||||||
(name 'my-guix)
|
(name 'my-guix)
|
||||||
(url "https://my-git-repo/guix.git"))
|
(url "https://my-git-repo/guix.git"))
|
||||||
%default-channels))))
|
%default-channels)))))))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
In the same spirit, this builds all the packages that are part of the
|
In the same spirit, this builds all the packages that are part of the
|
||||||
|
@ -27209,7 +27216,10 @@ In the same spirit, this builds all the packages that are part of the
|
||||||
located in the @code{conf} channel.
|
located in the @code{conf} channel.
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(simple-cuirass-services
|
(service cuirass-service-type
|
||||||
|
(cuirass-configuration
|
||||||
|
(specifications
|
||||||
|
(simple-cuirass-configuration->specs
|
||||||
(simple-cuirass-configuration
|
(simple-cuirass-configuration
|
||||||
(build (list
|
(build (list
|
||||||
(build-manifest
|
(build-manifest
|
||||||
|
@ -27222,7 +27232,7 @@ located in the @code{conf} channel.
|
||||||
(name 'conf)
|
(name 'conf)
|
||||||
(url "https://my-git-repo/conf.git"))
|
(url "https://my-git-repo/conf.git"))
|
||||||
%default-channels))
|
%default-channels))
|
||||||
(non-package-channels '(conf))))
|
(non-package-channels '(conf)))))))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
Finally, @code{simple-cuirass-services} takes as a second optional
|
Finally, @code{simple-cuirass-services} takes as a second optional
|
||||||
|
|
|
@ -60,8 +60,7 @@
|
||||||
simple-cuirass-configuration
|
simple-cuirass-configuration
|
||||||
simple-cuirass-configuration?
|
simple-cuirass-configuration?
|
||||||
|
|
||||||
%default-cuirass-config
|
simple-cuirass-configuration->specs))
|
||||||
simple-cuirass-services))
|
|
||||||
|
|
||||||
;;;; Commentary:
|
;;;; Commentary:
|
||||||
;;;
|
;;;
|
||||||
|
@ -419,13 +418,7 @@ CONFIG."
|
||||||
(systems simple-cuirass-configuration-systems
|
(systems simple-cuirass-configuration-systems
|
||||||
(default (list (%current-system))))) ;list of strings
|
(default (list (%current-system))))) ;list of strings
|
||||||
|
|
||||||
(define %default-cuirass-config
|
(define* (simple-cuirass-configuration->specs config)
|
||||||
(cuirass-configuration
|
|
||||||
(specifications #~())))
|
|
||||||
|
|
||||||
(define* (simple-cuirass-services config
|
|
||||||
#:optional
|
|
||||||
(cuirass %default-cuirass-config))
|
|
||||||
(define (format-name name)
|
(define (format-name name)
|
||||||
(if (string? name)
|
(if (string? name)
|
||||||
name
|
name
|
||||||
|
@ -475,13 +468,4 @@ CONFIG."
|
||||||
(#:build-outputs . ())
|
(#:build-outputs . ())
|
||||||
(#:priority . 1))))
|
(#:priority . 1))))
|
||||||
|
|
||||||
(list
|
#~(list '#$(config->spec config)))
|
||||||
(service cuirass-service-type
|
|
||||||
(cuirass-configuration
|
|
||||||
(inherit cuirass)
|
|
||||||
(specifications #~(list
|
|
||||||
'#$(config->spec config)))))
|
|
||||||
(service postgresql-service-type
|
|
||||||
(postgresql-configuration
|
|
||||||
(postgresql postgresql-10)))
|
|
||||||
(service postgresql-role-service-type)))
|
|
||||||
|
|
|
@ -132,11 +132,7 @@
|
||||||
(remote-server (and remote-build?
|
(remote-server (and remote-build?
|
||||||
(cuirass-remote-server-configuration)))
|
(cuirass-remote-server-configuration)))
|
||||||
(host "0.0.0.0")
|
(host "0.0.0.0")
|
||||||
(use-substitutes? #t)))
|
(use-substitutes? #t)))))
|
||||||
(service postgresql-service-type
|
|
||||||
(postgresql-configuration
|
|
||||||
(postgresql postgresql-10)))
|
|
||||||
(service postgresql-role-service-type)))
|
|
||||||
|
|
||||||
(define (run-cuirass-test name os)
|
(define (run-cuirass-test name os)
|
||||||
(define os*
|
(define os*
|
||||||
|
@ -286,6 +282,20 @@
|
||||||
(description "Connect to a Cuirass server with remote build.")
|
(description "Connect to a Cuirass server with remote build.")
|
||||||
(value (run-cuirass-test name os)))))
|
(value (run-cuirass-test name os)))))
|
||||||
|
|
||||||
|
(define simple-cuirass-service
|
||||||
|
(service cuirass-service-type
|
||||||
|
(cuirass-configuration
|
||||||
|
(specifications
|
||||||
|
(simple-cuirass-configuration->specs
|
||||||
|
(simple-cuirass-configuration
|
||||||
|
(build 'all)
|
||||||
|
(channels
|
||||||
|
(list (channel
|
||||||
|
(name 'guix)
|
||||||
|
(url "file:///tmp/cuirass-main/")))))))
|
||||||
|
(host "0.0.0.0")
|
||||||
|
(use-substitutes? #t))))
|
||||||
|
|
||||||
(define %cuirass-simple-test
|
(define %cuirass-simple-test
|
||||||
(let ((os (operating-system
|
(let ((os (operating-system
|
||||||
(inherit %simple-os)
|
(inherit %simple-os)
|
||||||
|
@ -293,17 +303,8 @@
|
||||||
(append
|
(append
|
||||||
(list cow-service
|
(list cow-service
|
||||||
(service dhcp-client-service-type)
|
(service dhcp-client-service-type)
|
||||||
git-service)
|
git-service
|
||||||
(simple-cuirass-services
|
simple-cuirass-service)
|
||||||
(simple-cuirass-configuration
|
|
||||||
(build 'all)
|
|
||||||
(channels (list (channel
|
|
||||||
(name 'guix)
|
|
||||||
(url "file:///tmp/cuirass-main/")))))
|
|
||||||
(cuirass-configuration
|
|
||||||
(inherit %default-cuirass-config)
|
|
||||||
(host "0.0.0.0")
|
|
||||||
(use-substitutes? #t)))
|
|
||||||
(operating-system-user-services %simple-os))))))
|
(operating-system-user-services %simple-os))))))
|
||||||
(system-test
|
(system-test
|
||||||
(name "cuirass-simple")
|
(name "cuirass-simple")
|
||||||
|
|
Reference in a new issue