forked from vieter-v/vieter
feat: queue one-time builds from CLI
This commit is contained in:
parent
6a208dbe6c
commit
2cc3e8404e
4 changed files with 69 additions and 18 deletions
|
|
@ -1,6 +1,7 @@
|
|||
module client
|
||||
|
||||
import build { BuildConfig }
|
||||
import web.response { Response }
|
||||
|
||||
// poll_jobs requests a list of new build jobs from the server.
|
||||
pub fn (c &Client) poll_jobs(arch string, max int) ![]BuildConfig {
|
||||
|
|
@ -11,3 +12,13 @@ pub fn (c &Client) poll_jobs(arch string, max int) ![]BuildConfig {
|
|||
|
||||
return data.data
|
||||
}
|
||||
|
||||
pub fn (c &Client) queue_job(target_id int, arch string, force bool) !Response<string> {
|
||||
data := c.send_request<string>(.post, '/api/v1/jobs/queue', {
|
||||
'target': target_id.str()
|
||||
'arch': arch
|
||||
'force': force.str()
|
||||
})!
|
||||
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue