diff man/sci.7 @ 64:562372396019

misc: improve manual pages and documentation
author David Demelier <markand@malikania.fr>
date Thu, 18 Aug 2022 20:17:18 +0200
parents 084dee2bef50
children 5076be758687
line wrap: on
line diff
--- a/man/sci.7	Thu Aug 18 12:29:28 2022 +0200
+++ b/man/sci.7	Thu Aug 18 20:17:18 2022 +0200
@@ -71,7 +71,7 @@
 The process handle different kind of entities in the database.
 .\" PROJECTS
 .Ss PROJECTS
-A project is an user description of what to be automated and tested. It has a
+A project is a user description of what to be automated and tested. It has a
 name, description, project URL and a script to execute. They can be created
 using the
 .Cm project-add
@@ -97,6 +97,126 @@
 installation, there will be four job results. It has an exit code (got from the
 user script), a log console (capture from standard output and error) and a
 timestamp when it was started.
+.\" GETTING STARTED
+.Sh GETTING STARTED
+To setup the
+.Nm
+framework you need at least:
+.Bl -enum
+.It
+A daemon
+.Xr scid 8
+running and accessible remotely.
+.It
+One or more
+.Xr sciworkerd 8
+running on a machine that can access
+.Xr scid 8 .
+.It
+Add some projects and register those workers using
+.Xr scictl 8
+utility.
+.El
+.\" Setup scid
+.Ss Setup scid
+The
+.Xr scid 8
+daemon does not require much configuration, you can specify the database file
+to use with its appropriate options. Otherwise, you can simply run the daemon
+with no arguments. It will initialize the database and generate a default API
+key that
+.Xr scictl 8
+and
+.Xr sciworkerd 8
+require to perform requests. Use the
+.Cm api-get
+command to get that key.
+.Bd -literal -offset indent
+$ scid
+Or
+$ scid -d /var/db/scid.db
+.Ed
+.Pp
+Retrieve the stored key:
+.Bd -literal -offset indent
+$ scid api-get
+1234567890secretABCDEF
+.Ed
+.Pp
+Both
+.Xr scictl 8
+and
+.Xr sciworkerd 8
+understand the same options and environment variables. So let's set the API key
+as environment variable for the next chapters.
+.Bd -literal -offset indent
+export SCI_API_KEY=1234567890secretABCDEF
+.Ed
+.Pp
+If you run
+.Xr scid 8
+on a machine that is not on the same as the worker, you also
+need to specify the
+.Ev SCI_API_URL
+environment variable.
+.Bd -literal -offset indent
+export SCI_API_URL=http://127.0.0.1
+.Ed
+.\" Setup a worker
+.Ss Setup a worker
+To register a worker, use the
+.Cm worker-add
+command from
+.Xr scictl 8
+utility.
+.Bd -literal -offset indent
+scictl worker-add openbsd "OpenBSD 7.2"
+.Ed
+.Pp
+It is
+.Em strongly
+advised to run a
+.Xr sciworkerd 8
+instance inside a chroot or a virtual machine, remember that it will fetch the
+script code remotely!
+.Bd -literal -offset indent
+$ sciworkerd
+Or
+$ sciworkerd -j2
+.Ed
+.Pp
+Please make sure to read
+.Xr sciworkerd 8
+manual page for more tuning options.
+.\" Register a project
+.Ss Register a project
+Create a project named
+.Em hello
+with a description, URL, a homepage and a script file to execute. The script
+code can be of any language but it's advised that you stick with some
+interpreted language as many different workers may execute it.
+.Bd -literal -offset indent
+$ scictl project-add hello "Hello World" "http://hello.org" "hello.sh"
+.Ed
+.\" Register jobs
+.Ss Register jobs
+Now, you may want to register a job that will be executed for every worker.
+.Pp
+Use the
+.Cm job-add
+command from
+.Xr scictl 8
+utility. The
+.Ar tag
+argument is the unique argument that will be passed to the script code. In our
+case we will assume it's a revision from a SCM repository.
+.Bd -literal -offset indent
+$ scictl job-add hello 67470b67e460
+.Ed
+.Pp
+And after that, any
+.Xr sciworkerd 8
+instance will fetch the job, run it and send the result.
 .\" SEE ALSO
 .Sh SEE ALSO
 .Xr scictl 8 ,