xaizek / fragile (License: AGPLv3+) (since 2018-12-07)
Simple lightweight CI, attempting to be somewhat Unix-like in its philosophy.
<root> / INSTALL.md (431086314df3e4d5eb62651474b2fdb09b93f9dd) (2,080B) (mode 100644) [raw]
## Structure ##

There are two parts of the application:
 * web-interface
 * daemon

### Installation ###

One will probably want to install them in two separate locations, but they can
reside in the same directory.

## Configuration ##

Before installing files, copy `config.php.sample` to `config.php` and fill in
all the values of according to comments there.  This file holds configuration of
both web and daemon parts and should be kept in sync between the two parts.

See `hooks/` directory and `README` file there for instructions on using hooks.

## Installation ##

Run the `install` script to perform the installation:

    install <web-path> <daemon-path>

Start the daemon and it will create database, web-interface will create it too,
but only if it has corresponding permissions.

### Managing builders ###

Builders are just scripts in `<web-path>/builders` directory.  Names are those
scripts are names of builders.  Script exit code should indicate result of a
build.  When script is run:

 * `$FRAGILE_REPO` environment variable points to location of checked out
   repository;
 * current directory is build directory.

Use dummy builders from `builders/` directory during setup to check
web-interface isolated from actual build process.

#### Conditional builders ####

In addition to `<web-path>/builders` directory builders from
`<web-path>/builders/<name>` (where `<name>` is branch name probably) are also
scheduled, if that directory exists.  This can be used to run some builders only
for specific branches.

### Scheduling a build ###

Run `new.php` passing it refname and revision ID (in this order) to work with.

### Installing the daemon ###

Example of init-script for `/etc/init.d/` is at `other/rc.fragile`.

### Automating builds ###

One way to do this is to create bare repository for pushes.  Assuming that the
repository is where daemon gets installed, just copy `other/post-update` to
hooks (this is for Git, other VCSs might differ).

### Updates ###

Don't forget to remove database before an update to address possible changes of
tables.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/fragile

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/fragile

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master