wait_for_build
Waits for an Odoo.sh project branch build to finish, optionally for a specific commit after a push, returning build status and next steps if it times out.
Instructions
Wait for a build of a branch of a project to finish, for timeout seconds at most: the build of that number, or the latest one. With commit, the first 7 to 64 digits of a hash, the build of that commit, once the branch has one: give it right after a push, when the latest build is still the previous one. A build that has not finished in time is not an error: finished is false, and next_step says to call again.
Returns: the build as last seen, or none while the branch has no build of commit, finished, the timeout applied, timeout_capped, true when it was lowered, and next_step, set while the build has not finished.
Touches: reads only
Bounds: timeout seconds, 30 by default and 50 at most, longer when Odoo.sh is slow to answer for the branch or for a commit's build; six requests to Odoo.sh and one socket, more when the socket drops, and one request every 3 seconds while a commit has no build.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | ||
| commit | No | ||
| project | Yes | ||
| timeout | No | ||
| build_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| build | Yes | ||
| timeout | Yes | ||
| finished | Yes | ||
| next_step | Yes | ||
| timeout_capped | Yes |