2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00
Cuirass continuous integration tool https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git
Go to file
Mathieu Othacehe 158966dca0
Fix /api/latestbuilds ordering.
Evaluations are added sequentially to database but builds are not always
registered nor performed in order. This means that a build corresponding to an
older evaluation can be returned first if it was completed last. Order by
descending evaluation id to prevent it.

* src/cuirass/database.scm (db-get-builds): Add "evaluation" order.
* src/cuirass/http.scm (url-handler): Order latestbuilds by descending
evaluation number.
2021-01-31 21:09:17 +01:00
bin Fix concurrent database creation. 2021-01-15 15:07:15 +01:00
build-aux Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
doc Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
examples Add support for build products downloading. 2020-06-10 16:42:21 +02:00
src Fix /api/latestbuilds ordering. 2021-01-31 21:09:17 +01:00
tests Remove workers hash table. 2021-01-31 10:31:01 +01:00
.dir-locals.el Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
.gitignore Add remote build support. 2021-01-06 21:06:04 +01:00
bootstrap build: Add 'bootstrap' script. 2016-08-02 19:04:53 +02:00
configure.ac Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
COPYING Initial commit. 2016-05-29 19:53:17 +02:00
Makefile.am Add machine field to Worker table. 2021-01-30 14:18:59 +01:00
README Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
TODO.org Add TODO.org. 2021-01-21 13:04:19 +01:00

-*- mode: org -*-

Cuirass is a continuous integration tool using GNU Guix.

* Requirements

Cuirass currently depends on the following packages:

  - GNU Guile 3.0.x or 2.2.x
  - GNU Guix (and all its development dependencies)
  - GNU Make
  - Guile-JSON 3.x
  - Guile-Squee
  - Guile-Git
  - Guile-zlib
  - Fibers

A convenient way to install those dependencies is to install Guix and execute
the following command:

#+BEGIN_EXAMPLE
   $ guix environment -l build-aux/guix.scm
#+END_EXAMPLE

This will build and enter an environment which provides all the necessary
dependencies.

* Build Instructions

When all the dependencies are available on you system, in order to build and
install Cuirass, you can proceed with the usual:

#+BEGIN_EXAMPLE
   $ ./configure && sudo make install
#+END_EXAMPLE

An alternative way is to directly install Cuirass in your Guix profile, using:

#+BEGIN_EXAMPLE
   $ guix package -f build-aux/guix.scm
#+END_EXAMPLE

To build it, but not install it, run:

#+BEGIN_EXAMPLE
   $ guix build -f build-aux/guix.scm
#+END_EXAMPLE

* Database connection

Cuirass uses PostgreSQL to store information about jobs, past build results
and to coordinate the execution of jobs.  The database connection string must
be passed to Cuirass using the =database= argument, under the keyword/value
format described [[https://www.postgresql.org/docs/10/libpq-connect.html#LIBPQ-CONNSTRING][here]].  The PostgreSQL database must be created beforehand.

For instance, to connect using Unix sockets to the =cuirass= database:

#+BEGIN_EXAMPLE
  ./pre-inst-env cuirass --database="dbname=cuirass host=/var/run/postgresql"
#+END_EXAMPLE

or using a TCP connection:

#+BEGIN_EXAMPLE
  ./pre-inst-env cuirass --database="dbname=cuirass host=127.0.0.1"
#+END_EXAMPLE

* Run tests

Cuirass tests also require an access to a PostgreSQL database.  This database
must be dedicated to testing as its content will be dropped.  The database
name and host must be passed using =CUIRASS_DATABASE= and =CUIRASS_HOST=
environment variables respectively.

#+BEGIN_EXAMPLE
CUIRASS_DATABASE="test_tmp" CUIRASS_HOST="/var/run/postgresql" make check
#+END_EXAMPLE

* Example

A quick way to manually test Cuirass is to execute:

#+BEGIN_EXAMPLE
  ./pre-inst-env cuirass --specifications=examples/hello-singleton.scm --database="dbname=cuirass host=/var/run/postgresql"
#+END_EXAMPLE

This will read the file "examples/hello-singleton.scm" which contains a list
of specifications and add them to the =cuirass= database.

Cuirass then loops evaluating/building the specs.  The database keeps track
of the specifications in order to allow users to accumulate specifications.
To resume the evaluation/build process you can execute the same command
without the '--specifications' option:

#+BEGIN_EXAMPLE
  ./pre-inst-env cuirass --database="dbname=cuirass host=/var/run/postgresql"
#+END_EXAMPLE

To start the web interface run:

#+BEGIN_EXAMPLE
  ./pre-inst-env cuirass --database="dbname=cuirass host=/var/run/postgresql" --web
#+END_EXAMPLE

* Contributing

See the manual for useful hacking informations, by running

#+BEGIN_EXAMPLE
  info -f doc/cuirass.info "Contributing"
#+END_EXAMPLE