summaryrefslogtreecommitdiff
path: root/README
blob: 5fba99ca3d63fe73a463520ad5b60541120bf301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Ick - a continuous integration system
=============================================================================

Introduction
-----------------------------------------------------------------------------

Ick2 will become a CI system. It is not there yet. It is not even
ALPHA level yet.


Hacking
-----------------------------------------------------------------------------

Ick2 is written in Python 2 (do not ask for Python 3, it will happen
when it happens).

There are some unit and integration tests written for the controller's
HTTP API. To run them, run `./check`. You may add any command line
parameters than `yarn` accepts.


Running
-----------------------------------------------------------------------------

To run the controller, you should use uWSGI with Python support. On
Debian, install `uwgi-plugin-python` and run:

    uwsgi --plugin python27 --http-socket 127.0.0.1:12765 \
    --wsgi-file ctrlruwsgi \
    --processes 1 --threads 1 --pyargv "--projects=projects.yaml"

You need to create `projects.yaml` yourself. It might look like this:

    projects:
      foo:
        shell_steps:
          - for x in $(seq 100); do echo hello, world, $x; sleep 1; done

After this, `http://localhost:12765` is the controller's base URL, and
you can do things like:

* `GET http://localhost:12765/projects` — list all projects known to
  controller
* `GET http://localhost:12765/projects/foo/+trigger` — trigger build
  of project `foo` (substitute name of one of your own projects)
* `GET http://localhost:12765/projects/foo/logs/current` — get build
  log (output) of the currently executing build step of project `foo`
* `GET http://localhost:12765/projects/foo/logs/previous` — get build
  log (output) of the latest finished build step of project `foo`

To actually run builds, you need to run `worker-manager`:

    ./worker-manager --controller http://localhost:12765

The substitute the correct URL for the controller.


Using the .deb package
-----------------------------------------------------------------------------

To build the .deb package (you may have to fix the version number):

    git archive HEAD | xz > ../ick2_0.2.1+git.orig.tar.xz
    debuild -us -uc
    sudo debi

After this, you'll want to create `/etc/ick2/projects.yaml`, for
example:

    projects:
      count:
        shell_steps: 
        - for x in $(seq 100); do echo hello, $x; sleep 1; done
    
Also, you'll want to enable and start the ick2 service:

    sudo systemctl enable ick2
    sudo systemctl start ick2

After this:

    curl http://localhost:12765/projects
    curl http://localhost:12765/projects/count/+trigger
    ./worker-manager http://localhost:12765

Good luck!


Legalese
-----------------------------------------------------------------------------

While Ick2 itself is under the AGPL3+ license (see below), this
license does NOT apply to clients of the HTTP API it provides.

Copyright 2017  Lars Wirzenius

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.