|
1 | 1 | Configuration
|
2 | 2 | =============
|
3 | 3 |
|
4 |
| -snowpatch configuration files are in [TOML](https://en.wikipedia.org/wiki/TOML) |
| 4 | +snowpatch configuration files are in [RON](https://github.com/ron-rs/ron) |
5 | 5 | format.
|
6 | 6 |
|
7 | 7 | Example configuration files can be found in the [examples](../examples)
|
8 | 8 | directory.
|
9 | 9 |
|
10 |
| -A snowpatch configuration file contains three global configuration sections |
11 |
| -(tables, in TOML terms), `git`, `patchwork` and `jenkins`, and a `projects` |
12 |
| -section containing per-project configuration. |
13 |
| - |
14 |
| - |
15 |
| -Git Configuration |
16 |
| ------------------ |
17 |
| - |
18 |
| -The `git` section contains settings for the git SSH transport. |
19 |
| - |
20 |
| -Example: |
21 |
| - |
22 |
| -``` |
23 |
| -[git] |
24 |
| -user = "git" |
25 |
| -public_key = "/home/ruscur/.ssh/id_rsa.pub" |
26 |
| -private_key = "/home/ruscur/.ssh/id_rsa" |
27 |
| -``` |
28 |
| - |
29 |
| -- `user`: git SSH username (Currently, snowpatch only supports a single git |
30 |
| - username for all git remotes - this will be addressed in future.) |
31 |
| - |
32 |
| -- `public_key`: path to SSH public key, usually `~/.ssh/id_rsa.pub` (optional) |
33 |
| - |
34 |
| -- `private_key`: path to SSH private key, usually `~/.ssh/id_rsa` |
35 |
| - |
36 |
| -- `passphrase`: passphrase for SSH private key (optional) |
37 |
| - |
38 |
| -Patchwork Configuration |
39 |
| ------------------------ |
40 |
| - |
41 |
| -The `patchwork` section contains settings for the Patchwork instance being |
42 |
| -monitored. |
43 |
| - |
44 |
| -Example: |
45 |
| - |
46 |
| -``` |
47 |
| -[patchwork] |
48 |
| -url = "https://russell.cc/patchwork" |
49 |
| -port = 443 # optional |
50 |
| -user = "ruscur" |
51 |
| -pass = "banana" |
52 |
| -polling_interval = 10 # polling interval in minutes |
53 |
| -``` |
54 |
| - |
55 |
| -- `url`: base URL of the Patchwork instance |
56 |
| - |
57 |
| -- `port`: port number (optional) |
58 |
| - |
59 |
| -- `user`: Patchwork username (must be used in conjuction with `pass`) |
60 |
| - |
61 |
| -- `pass`: Patchwork password (must be used in conjuction with `user`) |
62 |
| - |
63 |
| -- `token`: Patchwork API token (can be used instead of `user`/`pass`) |
64 |
| - |
65 |
| -- `polling_interval`: Patchwork polling interval, in minutes |
66 |
| - |
67 |
| - |
68 |
| -Jenkins Configuration |
69 |
| ---------------------- |
70 |
| - |
71 |
| -The `jenkins` section contains settings for the Jenkins instance being used for |
72 |
| -builds. |
73 |
| - |
74 |
| -Example: |
75 |
| - |
76 |
| -``` |
77 |
| -[jenkins] |
78 |
| -url = "https://jenkins.ozlabs.ibm.com" |
79 |
| -port = 443 |
80 |
| -username = "patchwork" |
81 |
| -token = "33333333333333333333333333333333" |
82 |
| -``` |
83 |
| - |
84 |
| -- `url`: base URL of the Jenkins instance |
85 |
| - |
86 |
| -- `port`: port number (optional) |
87 |
| - |
88 |
| -- `username`: Jenkins username (optional, must be used in conjunction with |
89 |
| - `token`) |
90 |
| - |
91 |
| -- `token`: Jenkins API token (optional, must be used in conjunction with |
92 |
| - `username`) |
93 |
| - |
94 |
| - |
95 |
| -Project Configuration |
96 |
| ---------------------- |
97 |
| - |
98 |
| -The `projects` section consists of subsections for each project, which must be |
99 |
| -named `project.PROJECT_NAME`, where `PROJECT_NAME` corresponds to the short name |
100 |
| -("linkname") of the project in Patchwork. |
101 |
| - |
102 |
| -Within each project subsection, there is an array called `jobs` which consists |
103 |
| -of a table for each Jenkins job that should executed. |
104 |
| - |
105 |
| -Example: |
106 |
| - |
107 |
| -``` |
108 |
| - [projects.linuxppc-dev] |
109 |
| - repository = "/home/ruscur/Documents/linux" |
110 |
| - branches = ["master", "powerpc-next"] |
111 |
| - # test_all_branches defaults to true |
112 |
| - remote_name = "github" |
113 |
| - remote_uri = "[email protected]:ruscur/linux.git" |
114 |
| - base_remote_name = "origin" |
115 |
| - push_results = false |
116 |
| -
|
117 |
| - [[projects.linuxppc-dev.jobs]] |
118 |
| - job = "linux-build-manual" |
119 |
| - remote = "GIT_REPO" |
120 |
| - branch = "GIT_REF" |
121 |
| - artifact = "snowpatch.txt" |
122 |
| - hefty = true |
123 |
| - DEFCONFIG_TO_USE = "pseries_le_defconfig" |
124 |
| -
|
125 |
| - [[projects.linuxppc-dev.jobs]] |
126 |
| - job = "linux-build-manual" |
127 |
| - remote = "GIT_REPO" |
128 |
| - branch = "GIT_REF" |
129 |
| - artifact = "snowpatch.txt" |
130 |
| - hefty = false |
131 |
| - DEFCONFIG_TO_USE = "ppc64le_defconfig" |
132 |
| -``` |
133 |
| - |
134 |
| -- `repository`: path to local clone of git repository |
135 |
| - |
136 |
| -- `branches`: a list of base branches that patches should be tested against |
137 |
| - |
138 |
| -- `test_all_branches`: if true, each patch will be tested against all base |
139 |
| - branches. If false, a patch will only be tested against the first base branch |
140 |
| - to which it successfully applies. (Optional, defaults to true) |
141 |
| - |
142 |
| -- `remote_name`: the name of the remote, as defined in the local git repository, |
143 |
| - to which branches should be pushed so that the Jenkins server can pull them |
144 |
| - |
145 |
| -- `remote_uri`: the URI of the remote |
146 |
| - |
147 |
| -- `base_remote_name`: the name of the remote where base branches are retrieved |
148 |
| - from (Optional, defaults to value of remote_name) |
149 |
| - |
150 |
| -- `push_results`: whether test results should be pushed to Patchwork for this |
151 |
| - project |
152 |
| - |
153 |
| -- `branch_preserve_policy`: set the policy for how snowpatch will handle |
154 |
| - branches on git remotes after tests have run. |
155 |
| - |
156 |
| - "ALL": preserves all branches on the remote. |
157 |
| - "SERIES": only preserves full series or standalone patches. |
158 |
| - "NONE": deletes branches on the remote after testing. |
159 |
| - |
160 |
| - (Optional, defaults to NONE) |
161 |
| - |
162 |
| -- `branch_preserve_remote`: only valid if `branch_preserve_policy` is not NONE. |
163 |
| - Specify the name of a git remote that will only be used for branch |
164 |
| - preservation. If set, branches will be deleted on the main remote. (Optional) |
165 |
| - |
166 |
| -Individual jobs contain the following: |
167 |
| - |
168 |
| -- `job`: the name of the Jenkins job to run |
169 |
| - |
170 |
| -- `title`: title of the test which will appear in Patchwork (Optional, defaults |
171 |
| - to job name) |
172 |
| - |
173 |
| -- `remote`: the name of the Jenkins build parameter in which the URI of the git |
174 |
| - remote will be filled |
175 |
| - |
176 |
| -- `branch`: the name of the Jenkins build parameter in which the name of the git |
177 |
| - branch to which the patch has been applied will be filled |
178 |
| - |
179 |
| -- `base`: the name of the Jenkins build parameter in which the commit ID on top |
180 |
| - of which the patch has been applied will be filled (Optional) |
181 |
| - |
182 |
| -- `hefty`: whether this job is a "hefty" test. Hefty tests will only be run on |
183 |
| - the final patch of a series, while non-hefty tests will be run on every patch |
184 |
| - in the series. (Optional, defaults to false) |
185 |
| - |
186 |
| -- `warn_on_fail`: if true, this job will return a warning rather than a failure |
187 |
| - if it fails (Optional, defaults to false) |
188 |
| - |
189 |
| -- Any further parameters will be passed to Jenkins as build parameters |
| 10 | +The configuration format isn't stable and is not currently documented. |
| 11 | +Check the examples and [config.rs](../src/config.rs) to get an idea. |
0 commit comments