summaryrefslogtreecommitdiff
path: root/README
blob: 064ac0feda85d85cb7ee7e240c88801c11b2fc98 (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Ick - a continuous integration system
=============================================================================

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

Ick2 is a CI system. It is not there yet.


Installing
-----------------------------------------------------------------------------

See `INSTALL`.


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

Ick2 is written in Python 3 and targets Debian 9 (stretch) or later.

There are some unit and integration tests written for the controller's
HTTP API. The integration tests can start a local instance of the
controller; either of the following works:

    ./check
    ./check yarns

You can add any command line parameters `yarn` accepts, but you have
to specify `local` explicitly:

    ./check local -v --tempdir tmp --snapshot

You can also run the integration tests against an existing remote
setup:

    ./check https://ick-controller
    ./check https://ick-controller -v --tempdir tmp --snapshot

Please make sure at least the local `./check` passes with your
changes, before submitting them.


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

To run the controller, you should use `./start_ick`. It needs
`gunicorn3`. In general, you need all the dependencies from
`debian/control` installed to run the controller.

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.


The icktool utility
-----------------------------------------------------------------------------

The `icktool` utility can generate a token. To configure: create
`~/.config/icktool/icktool.yaml` with the following content:

    config:
        controller: https://ick-controller
        token-private-key-cmd: pass show ick-controller/token_key

Alternatively, you can use the command line options with the same
names. To use:

    icktool token
    icktool version

Icktool will gain more functionality in the future.

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!


Code of conduct
-----------------------------------------------------------------------------

Please note that this project is released with a Contributor Code of
Conduct. By participating in this project you agree to abide by its
terms.

See the file code-of-conduct.md for the code.


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

While Ick2 itself is under the AGPL3+ license, a copy of which is
included as `COPYING` in the source code of this program. This license
does NOT apply to clients of the HTTP API it provides.

Copyright 2017-2018  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/>.