Build lists API
- Get a single build list
- Create build list
- Cancel build list
- Publish build list
- Publish build list into testing
- Rerun tests
- Create container
- Reject publish build list
- List build lists
- List build lists for a project
- Destroy build list
Get a single build list
Block “Logs” is available only for new core.
The value of parameter “url” in block “Packages” is empty for old core.
GET /api/v1/build_lists/:id.json
Available statuses for parameter “container_status”:
-
4000
— waiting for request for publishing container; -
6000
— container has been published; -
7000
— container is being published; -
8000
— publishing error.
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "resource id",
"status": "status code",
"container_status": "container status code",
"container_path": "container path",
"new_core": "using new core",
"package_version": "package version",
"project": {
"id": "project id",
"name": "project name",
"visibility": "visibility (open/hidden)",
"fullname": "project fullname",
"url": "url to project data page",
"git_url": "path to project git",
"ssh_url": "path to project git over ssh",
"maintainer": {
"id": "user id",
"uname": "user uname",
"name": "user name",
"url": "api user path",
"email": "user email"
}
},
"build_for_platform": {
"id": "platform id",
"name": "platform name",
"visibility": "platform visibility",
"platform_type": "platform type",
"url": "platform data page path"
},
"save_to_repository": {
"id": "repository for package storage id",
"name": "repository for package storage name",
"url": "path to repository data page",
"platform": {
"id": "repository platform id",
"name": "repository platform name",
"url": "path to repository platform data page"
}
},
"arch": {
"id": "build architecture id",
"name": "build architecture name"
},
"update_type": "update type",
"auto_publish_status": "automated publising status",
"auto_create_container": "automated creation of container",
"use_cached_chroot": "use cached chroot",
"use_extra_tests": "use extra tests",
"save_buildroot": "save RPM buildroot",
"commit_hash": "last commit hash of project source",
"last_published_commit_hash": "last published commit hash of project source",
"priority": "build priority",
"duration": "build duration in seconds",
"created_at": "created at date and time",
"updated_at": "updated at date and time",
"advisory": {
"id": "advisory id",
"name": "advisory name",
"description": "advisory description",
"url": "path to advisory data page"
},
"mass_build": {
"id": "mass_build id",
"name": "mass_build name",
"url": "path to mass_build data page"
},
"user": {
"id": "id of user which created build",
"name": "user name",
"url": "url to user profile"
},
"publisher": {
"id": "publisher id",
"name": "publisher name",
"url": "url to publisher profile"
},
"include_repos": [
{
"id": "included repository id",
"name": "included repository name",
"url": "path to included repository data page",
"platform": {
"id": "repository platform id",
"name": "repository platform name",
"url": "path to repository platform data page"
}
}
],
"extra_repositories": [
{
"id": "extra repository id",
"name": "extra repository name",
"url": "path to extra repository data page",
"platform": {
"id": "repository platform id",
"name": "repository platform name",
"url": "path to repository platform data page"
}
}
],
"extra_build_lists": [
{
"id": "build list id",
"status": "build list status",
"container_path": "container path",
"url": "url to build list page"
}
],
"packages": [
{
"id": "package id",
"name": "package name",
"type": "package type (source/binary)",
"epoch": "package epoch",
"version": "package version",
"release": "package release",
"updated_at": "package last updated date",
"url": "package url",
"dependent_projects": [
{
"id": "project id",
"name": "project name",
"visibility": "visibility (open/hidden)",
"fullname": "project fullname",
"url": "url to project data page",
"git_url": "path to project git",
"ssh_url": "path to project git over ssh",
"maintainer": {
"id": "user id",
"uname": "user uname",
"name": "user name",
"url": "api user path",
"email": "user email"
},
"dependent_packages": [
"package name"
]
}
]
}
],
"logs": [
{
"file_name": "file name",
"size": "file size",
"url": "file url"
}
],
"url": "url to build list page"
}
}
Example:
{
"build_list": {
"id": 10,
"status": 6000,
"container_path": "/downloads/rosa2012/container/10",
"container_status": 6000,
"new_core": true,
"package_version": "rosa2012.1-0.1.309-1",
"project": {
"id": 666,
"name": "evil_tools",
"visibility": "open",
"fullname": "abf/evil_tools",
"url": "/api/v1/projects/666.json",
"git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
"ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
"maintainer": {
"id": 1,
"name": "Ivan Aivazovsky",
"uname": "ivan_aivazovsky",
"url": "/api/v1/users/1.json",
"email": "ivan.aivazovsky@email.ru "
}
},
"build_for_platform": {
"id": 1,
"name": "rosa2012",
"visibility": "open",
"platform_type": "main",
"url": "/api/v1/platforms/1.json"
},
"save_to_repository": {
"id": 12,
"name": "mr_evil/personal",
"url": "/api/v1/repositories/12.json",
"platform": {
"id": 2,
"name": "cocos_lts",
"url": "/api/v1/platforms/2.json"
}
},
"arch": {
"id": 1,
"name": "x84_64"
},
"created_at": 1349357795,
"updated_at": 1349358084,
"update_type": "bugfix",
"auto_publish_status": "default",
"auto_create_container": true,
"use_cached_chroot": true,
"use_extra_tests": true,
"save_buildroot": false,
"commit_hash": "4edafbe69632173a1800c4d7582b60b46bc1fb55",
"last_published_commit_hash": "59f606578d21683bbbf4152bcdc2ebf1dd1e2e37",
"priority": 0,
"duration": null,
"advisory": {
"id": 666,
"name": "at",
"description": "warpc/at",
"url": "/api/v1/advisories/666.json"
},
"mass_build": {
"id": 666,
"name": "rosa2012lts (main)",
"url": "/api/v1/mass_builds/666"
},
"user": {
"id": 49,
"name": "Mr. Evil",
"url": "/api/v1/users/49.json"
},
"publisher": {
"id": 50,
"name": "Mr. Good",
"url": "/api/v1/users/50.json"
},
"include_repos": [
{
"id": 16,
"name": "main",
"url": "/api/v1/repositories/16.json",
"platform": {
"id": 16,
"name": "warpc_personal",
"url": "/api/v1/platforms/16.json"
}
}
],
"extra_repositories": [
{
"id": 17,
"name": "main",
"url": "/api/v1/repositories/17.json",
"platform": {
"id": 17,
"name": "avokhmin_personal",
"url": "/api/v1/platforms/17.json"
}
}
],
"extra_build_lists": [
{
"id": 12345,
"status": 6000,
"container_path": "/downloads/warpc_personal/container/12345",
"url": "/api/v1/build_lists/12345.json"
}
],
"packages": [
{
"id": 1,
"name": "alpine",
"type": "binary",
"epoch": 1,
"version": "2.02",
"release": "1",
"updated_at": 1348060890,
"url": "http://file-store.rosalinux.ru/api/v1/file_stores/675bfe070075abd5b7b49ecf213e830ff2f56ae3",
"dependent_projects": [
{
"id": 666,
"name": "evil_tools",
"visibility": "open",
"fullname": "abf/evil_tools",
"url": "/api/v1/projects/666.json",
"git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
"ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
"maintainer": {
"id": 1,
"name": "Ivan Aivazovsky",
"uname": "ivan_aivazovsky",
"url": "/api/v1/users/1.json",
"email": "ivan.aivazovsky@email.ru "
},
"dependent_packages": [
"rpmdrake"
]
}
]
}
],
"logs": [
{
"file_name": "abfworker::rpm-worker-859694.log",
"size": "20014310",
"url": "http://file-store.rosalinux.ru/api/v1/file_stores/3a93e5553490e39b4cd50269d51ad8438b7e20b8"
}
],
"url": "/api/v1/build_lists/10.json"
}
}
Create build list
Create new build list for project.
POST /api/v1/build_lists.json
Input:
- project_id
- Required integer — Identifier project for which need to run assembly.
- commit_hash
- Required string — SHA of project commit for which need to run assembly.
- update_type
-
Required string — Informing customers about the priority and character of updates:
security
,bugfix
,enhancement
,recommended
ornewpackage
. - save_to_repository_id
- Required integer — Repository identifier for package storage. List of repositories can be find in api call: see repositories section.
- build_for_platform_id
- Required integer — Identifier of platform for which need to run assembly. List of platforms can be find in api call: list of platforms.
- include_repos
-
Required array of integers — Repositories to connect for building this build list. Repositories must belong to platform(build_for_platform_id) for which performed assembly. Use
extra_repositories
for connect repositories from personal platforms. - arch_id
- Required integer — Identifier architecture for which need to run assembly.
- auto_publish_status
-
Optional string —
default
to enable automatic publication build list if the build succeeds,testing
to enable automatic publication build list intotesting
sub-repository if the build succeeds,none
allow manually publication. If in repository for package storage disabled publication without QA, parameter auto_publish_status automatically will be set tonone
. - auto_create_container
-
Optional boolean —
true
to enable automatic creating container of build list if the build succeeds,false
allow manually creating. Default value:false
. - extra_repositories
-
Optional array of integers — Repositories to connect for building this build list. Available only if
save_to_repository
- personal repository. - extra_build_lists
-
Optional array of integers — Build lists with containers (
container_status
should be6000
) to connect for building this build list.
For main platform you can connect only build lists which have been saved into same platform.
Only build lists with the same architecture will be connected or oriented to the both architectures (the propertypublish_i686_into_x86_64
(only forrhel
) in the settings of project istrue
). - use_cached_chroot
-
Optional boolean —
true
to use a cached chroot for building of build list. Default value:false
. - use_extra_tests
-
Optional boolean —
true
to use a more complex testing of packages. Default value:true
. - save_buildroot
-
Optional boolean —
true
to save a RPM buildroot if build will fail. Default value:false
. - include_testing_subrepository
-
Optional boolean —
true
to connecttesting
subrepository for building this build list. Default value:false
. - external_nodes
-
Optional string —
owned
to use own external ABF node,everything
to use any external ABF node.
Request
{
"build_list": {
"project_id": "project id",
"commit_hash": "commit hash to build",
"update_type": "one of the update types",
"save_to_repository_id": "repository identifier for package storage",
"build_for_platform_id": "platform identifier of platform for build",
"auto_publish_status": "automated publising status",
"auto_create_container": "automated creation of container",
"use_cached_chroot": "use cached chroot",
"use_extra_tests": "use extra tests",
"save_buildroot": "save RPM buildroot",
"external_nodes": "external nodes",
"include_testing_subrepository": "include 'testing' subrepository",
"include_repos": [
"included repository id for each selected platform"
],
"extra_repositories": [
"extra repository id for each selected platform"
],
"extra_build_lists": [
"extra build list id with container for each selected platform"
],
"arch_id": "architecture identifier"
}
}
Request example:
{
"build_list": {
"project_id": "10",
"commit_hash": "751b0cad9cd1467e735d8c3334ea3cf988995fab",
"update_type": "bugfix",
"save_to_repository_id": 12,
"build_for_platform_id": 2,
"auto_publish_status": "default",
"auto_create_container": true,
"use_cached_chroot": true,
"use_extra_tests": true,
"save_buildroot": false,
"external_nodes": null,
"include_testing_subrepository": false,
"include_repos": [
54,
53
],
"extra_repositories": [
56,
55
],
"extra_build_lists": [
12345,
12346
],
"arch_id": 1
}
}
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Response example:
{
"build_list": {
"id": 56,
"message": "Build list for project version 'beta_2012', platform 'rosa2012' and architecture 'i586' has been created successfully"
}
}
Cancel build list
By this request you can cancel build list. Only build list with status build pending (2000) or build started (3000) can be canceled.
PUT /api/v1/build_lists/:id/cancel.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Build canceled"
}
}
{
"build_list": {
"id": null,
"message": "Errors during build cancelation!"
}
}
Publish build list
By this request you can publish build list. Only build list with status:
- build complete (0),
- publishing error (8000),
- tests failed (11000),
- build has been published into testing (12000),
- publishing error into testing (14000)
can be published.
Admin of platform/repository has access to publish build list again with status published (6000).
Be careful: secondary publication will be able to break relationships in the repository!
All extra build lists should be published before publishing this build list!
PUT /api/v1/build_lists/:id/publish.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Build is queued for publishing"
}
}
{
"build_list": {
"id": null,
"message": "Errors during build publishing!"
}
}
Publish build list into testing
By this request you can publish build list into testing
subrepository.
Only build list with status:
- build complete (0),
- publishing error (8000),
- tests failed (11000),
- build has been published into testing (12000),
- publishing error into testing (14000)
can be published.
PUT /api/v1/build_lists/:id/publish_into_testing.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Build is queued for publishing"
}
}
{
"build_list": {
"id": null,
"message": "Errors during build publishing!"
}
}
Rerun tests
By this request you can rerun tests. Tests can be rerun only for build list with statuses build complete (0), tests failed (11000).
PUT /api/v1/build_lists/:id/rerun_tests.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Build is queued for rerun tests"
}
}
{
"build_list": {
"id": null,
"message": "Errors during rerun tests!"
}
}
Create container
By this request you can create container. Container can be created only for build list with statuses build complete (0), build published (6000), build publish (7000), publishing error (8000), publishing rejected (9000), tests failed (11000).
PUT /api/v1/build_lists/:id/create_container.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Container is queued for creating"
}
}
{
"build_list": {
"id": null,
"message": "Errors during container creating!"
}
}
Reject publish build list
By this request you can reject publish build list. Only build list with status:
- build complete (0),
- publishing error (8000),
- tests failed (11000),
- build has been published into testing (12000),
- publishing error into testing (14000)
can be rejected.
PUT /api/v1/build_lists/:id/reject_publish.json
Parameters:
- id
- Integer identifier of current build list
Response:
{
"build_list": {
"id": "build list id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"build_list": {
"id": 10,
"message": "Build is rejected"
}
}
{
"build_list": {
"id": null,
"message": "Errors during build rejecting!"
}
}
List build lists
By this way you can search build list you need.
GET /api/v1/build_lists.json?<search params>
Parameters:
- page
- Optional Integer - page number of build lists results list.
- per_page
- Optional Integer - amount of build list per one page. Default 20, maximum 100.
- filter[status]
- Optional integer - code of the build status
-
-
0
— build complete; -
1
— platform not found; -
2
— platform pending; -
3
— project not found; -
4
— project version not found; -
666
— build error; -
2000
— build pending; -
2500
— rerun tests; -
2550
— build is being rerun tests; -
3000
— build started; -
4000
— waiting for response; -
5000
— build canceled; -
6000
— build has been published; -
7000
— build is being published; -
8000
— publishing error; -
9000
— publishing rejected; -
10000
— build is canceling; -
11000
— tests failed; -
12000
— build has been published into testing; -
13000
— build is being published into testing; -
14000
— publishing error into testing.
-
- filter[arch_id]
- Optional integer - identifier of the architecture.
- filter[project_name]
- Optional string — project name.
- filter[updated_at_start / updated_at_end]
- Optional unixtime - start and end of the build list last change date diapason.
- filter[ownership]
-
Optional
owned
,related
orindex
- ownership type. Default:owned
. - filter[mass_build_id]
- Optional integer — mass build identifier.
- filter[save_to_platform_id]
- Optional integer - platform id for build save.
- filter[build_for_platform_id]
- Optional integer - platform id for build.
- filter[save_to_repository_id]
- Optional integer - repository id for package storage.
Response:
{
"build_lists": [
{
"id": "build list id",
"status": "build list status",
"project_id": "project id",
"url": "build list page"
}
],
"url": "current url for build lists page"
}
Example of request url:
/api/v1/build_lists.json?filter[project_name]=rails
/api/v1/build_lists.json?filter[ownership]=owned&filter[status]=6000&filter[arch_id]=2
Examples of responses:
{
"build_lists": [
{
"id": 25,
"status": 6000,
"project_id": 10,
"url": "/api/v1/build_lists/25.json"
},
{
"id": 26,
"status": 6000,
"project_id": 20,
"url": "/api/v1/build_lists/26.json"
}
],
"url": "/api/v1/build_lists.json"
}
List build lists for a project
GET /api/v1/projects/:project_id/build_lists.json?<search params>
Parameters:
Look at List build lists
Response:
{
"build_lists": [
{
"id": "build list id",
"status": "build list status",
"project_id": "project id",
"url": "build list page"
}
],
"url": "current url for build lists page"
}
Example of request url:
/api/v1/projects/42/build_lists.json?filter[status]=6000
Examples of responses:
{
"build_lists": [
{
"id": 25,
"status": 6000,
"project_id": 10,
"url": "/api/v1/build_lists/25.json"
},
{
"id": 26,
"status": 6000,
"project_id": 20,
"url": "/api/v1/build_lists/26.json"
}
],
"url": "/api/v1/build_lists.json"
}
Destroy build list
You can’t destroy build list. Only cancel it. :)