Nächste: Dienste zur Stromverbrauchsverwaltung, Vorige: Network File System, Nach oben: Dienste [Inhalt][Index]
Cuirass ist ein Werkzeug zur kontinuierlichen Integration für Guix. Es kann sowohl bei der Entwicklung helfen als auch beim Anbieten von Substituten für andere (siehe Substitute).
Das Modul (gnu services cuirass)
stellt den folgenden Dienst zur
Verfügung:
Der Diensttyp des Cuirass-Dienstes. Sein Wert muss ein
cuirass-configuration
-Verbundsobjekt sein, wie im Folgenden
beschrieben.
Um Erstellungsaufträge („Build Jobs“) hinzuzufügen, müssen Sie sie im
specifications
-Feld der Konfiguration eintragen. Hier ist ein
Beispiel für einen Dienst, der das Guix-Repository regelmäßig lädt und die
Pakete aus einem der Manifeste erstellt. Manche der Pakete werden in der
Eingabe "eigene-pakete"
definiert, was als GUIX_PACKAGE_PATH
benutzt wird.
(define %cuirass-specs #~(list '((#:name . "my-manifest") (#:load-path-inputs . ("guix")) (#:package-path-inputs . ("eigene-pakete")) (#:proc-input . "guix") (#:proc-file . "build-aux/cuirass/gnu-system.scm") (#:proc . cuirass-jobs) (#:proc-args . ((subset . "manifests") (systems . ("x86_64-linux")) (manifests . (("config" . "guix/manifest.scm"))))) (#:inputs . (((#:name . "guix") (#:url . "git://git.savannah.gnu.org/guix.git") (#:load-path . ".") (#:branch . "master") (#:no-compile? . #t)) ((#:name . "config") (#:url . "https://git.example.org/config.git") (#:load-path . ".") (#:branch . "master") (#:no-compile? . #t)) ((#:name . "eigene-pakete") (#:url . "https://git.example.org/eigene-pakete.git") (#:load-path . ".") (#:branch . "master") (#:no-compile? . #t))))))) (service cuirass-service-type (cuirass-configuration (specifications %cuirass-specs)))
Die Informationen, die sich auf Erstellungsaufträge beziehen, werden direkt
in deren Spezifikation festgelegt, aber globale Einstellungen des
cuirass
-Prozesses sind über andere Felder der
cuirass-configuration
zugänglich.
Datentyp, der die Konfiguration von Cuirass repräsentiert.
log-file
(Vorgabe: "/var/log/cuirass.log"
)An welchen Ort die Protokolldatei geschrieben wird.
web-log-file
(Vorgabe: "/var/log/cuirass-web.log"
)An welchem Ort die Protokolldatei der Weboberfläche gespeichert wird.
queries-log-file
(Vorgabe: #f
)Location of the SQL queries log file. By default, SQL queries logging is disabled.
web-queries-log-file
(Vorgabe: #f
)Location of the web SQL queries log file. By default, web SQL queries logging is disabled.
cache-directory
(Vorgabe: "/var/cache/cuirass"
)Ort, wo Repositorys zwischengespeichert werden.
user
(Vorgabe: "cuirass"
)Besitzer des cuirass
-Prozesses.
group
(Vorgabe: "cuirass"
)Gruppe des Besitzers des cuirass
-Prozesses.
interval
(Vorgabe: 60
)Anzahl der Sekunden, bevor ein Repository wieder neu geladen wird und danach Cuirass-Aufträge behandelt werden.
queue-size
(default: 1
)Size of the database writer queue.
database
(Vorgabe: "/var/lib/cuirass/cuirass.db"
)An welchem Ort sich die sqlite-Datenbank befinden soll, die die Erstellungsergebnisse und bisher hinzugefügte Spezifikationen speichert.
ttl
(Vorgabe: (* 30 24 3600)
)Gibt an, wie viele Sekunden für Erstellungsergebnisse registrierte Müllsammlerwurzeln gültig bleiben („Time-to-live“, kurz TTL). Dadurch werden Erstellungsergebnisse für mindestens ttl-viele Sekunden geschützt.
port
(Vortrag: 8081
)Portnummer, die vom HTTP-Server benutzt wird.
host
(Vorgabe: "localhost"
)Auf der Netzwerkschnittstelle für den Rechnernamen host lauschen. Nach
Vorgabe werden Verbindungen vom lokalen Rechner localhost
akzeptiert.
specifications
(Vorgabe: #~'()
)Ein G-Ausdruck (siehe G-Ausdrücke), der zu einer Liste von
Spezifikationen ausgewertet wird, wobei jede Spezifikation eine assoziative
Liste ist (siehe Associations Lists in Referenzhandbuch zu GNU
Guile), deren Schlüssel Schlüsselwörter sind („Keywords“ wie z.B.
#:beispiel-für-ein-schlüsselwort
), wie im Beispiel oben gezeigt.
use-substitutes?
(Vorgabe: #f
)Hierdurch wird zugelassen, Substitute zu benutzen, damit nicht jede Abhängigkeit eines Auftrags erst aus ihrem Quellcode heraus erstellt werden muss.
one-shot?
(Vorgabe: #f
)Spezifikationen nur einmal auswerten und Ableitungen nur einmal erstellen.
fallback?
(Vorgabe: #f
)Pakete lokal erstellen, wenn das Substituieren einer vorerstellten Binärdatei fehlschlägt.
extra-options
(Vorgabe: '()
)Zusätzliche Befehlszeilenoptionen, die beim Ausführen des Cuirass-Prozesses mitgegeben werden sollen.
cuirass
(Vorgabe: cuirass
)Das Cuirass-Paket, das benutzt werden soll.
The Cuirass service configuration described above can be a little
intimidating. In particular, getting the right specifications
can
prove difficult. The simple-cuirass-configuration->specs
procedure
offers a way to generate those specifications
and thus setup a
continuous integration server more readily.
This procedure takes a simple-cuirass-configuration
record as
argument and returns the corresponding Cuirass specifications gexp.
Data type representing the configuration of a simple Cuirass instance.
build
(default: all
)The packages to be built by Cuirass. It defaults to all
, which means
that all the discovered packages in the subsequent channels
field are
to be selected.
It is also possible to set this field to a list of build-manifest
records, so that only the packages that are part of the declared manifests
are built. This record is described below.
channel-name
The name of the channel where the manifest is located.
manifest
The manifest path inside the channel.
channels
(Vorgabe: %default-channels
)The channels to be fetched by Cuirass (siehe Kanäle).
non-package-channels
(default: '()
)List the channel names that must not be searched for packages. That is often the case for the channel containing the manifest.
systems
(default: (list (%current-system))
)Build every discovered package for each system in this list. By default only the current system is selected.
Here is an example of how to setup a Cuirass instance that builds all the packages declared by Guix and a user repository. The package list is re-evaluated each time a commit is pushed in one of the declared channels.
(service cuirass-service-type
(cuirass-configuration
(specifications
(simple-cuirass-configuration->specs
(simple-cuirass-configuration
(build 'all)
(channels (cons (channel
(name 'my-guix)
(url "https://my-git-repo/guix.git"))
%default-channels)))))))
In the same spirit, this builds all the packages that are part of the
guix
or my-guix
channels and declared in the manifest located
in the conf
channel.
(service cuirass-service-type
(cuirass-configuration
(specifications
(simple-cuirass-configuration->specs
(simple-cuirass-configuration
(build (list
(build-manifest
(channel-name 'conf)
(manifest "guix/manifest.scm"))))
(channels (cons* (channel
(name 'my-guix)
(url "https://my-git-repo/guix.git"))
(channel
(name 'conf)
(url "https://my-git-repo/conf.git"))
%default-channels))
(non-package-channels '(conf)))))))
Finally, simple-cuirass-services
takes as a second optional argument
a cuirass-configuration
record. It can be used to customize the
configuration of the Cuirass instance.
(simple-cuirass-services (simple-cuirass-configuration (build 'all) (channels (cons (channel (name 'my-guix) (url "https://my-git-repo/guix.git")) %default-channels)) (non-package-channels '(conf))) (cuirass-configuration (inherit %default-cuirass-config) (host "0.0.0.0"))) ;listen on all interfaces.
Nächste: Dienste zur Stromverbrauchsverwaltung, Vorige: Network File System, Nach oben: Dienste [Inhalt][Index]