chore: please the great lint

web-stuff
Jef Roosens 2022-12-14 16:03:57 +01:00
parent 2cc3e8404e
commit d7a04c6ebf
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
4 changed files with 9 additions and 2 deletions

View File

@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Migrated codebase to V 0.3.2 * Migrated codebase to V 0.3.2
* Cron expression parser now uses bitfields instead of bool arrays * Cron expression parser now uses bitfields instead of bool arrays
* Added option to deploy using agent-server architecture instead of cron daemon * Added option to deploy using agent-server architecture instead of cron daemon
* Allow force-building packages, meaning the build won't check if the
repository is already up to date
* Allow scheduling builds on the server from the CLI tool instead of building
them locally
### Fixed ### Fixed

View File

@ -9,9 +9,9 @@ import build
// structure can manage images from any number of base images, paving the way // structure can manage images from any number of base images, paving the way
// for configurable base images per target/repository. // for configurable base images per target/repository.
struct ImageManager { struct ImageManager {
mut:
max_image_age int [required] max_image_age int [required]
// For each base images, one or more builder images can exist at the same mut:
// For each base image, one or more builder images can exist at the same
// time // time
images map[string][]string [required] images map[string][]string [required]
// For each base image, we track when its newest image was built // For each base image, we track when its newest image was built

View File

@ -13,6 +13,8 @@ pub fn (c &Client) poll_jobs(arch string, max int) ![]BuildConfig {
return data.data return data.data
} }
// queue_job adds a new one-time build job for the given target to the job
// queue.
pub fn (c &Client) queue_job(target_id int, arch string, force bool) !Response<string> { 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', { data := c.send_request<string>(.post, '/api/v1/jobs/queue', {
'target': target_id.str() 'target': target_id.str()

View File

@ -20,6 +20,7 @@ fn (mut app App) v1_poll_job_queue() web.Result {
return app.json(.ok, new_data_response(out)) return app.json(.ok, new_data_response(out))
} }
// v1_queue_job allows queueing a new one-time build job for the given target.
['/api/v1/jobs/queue'; auth; post] ['/api/v1/jobs/queue'; auth; post]
fn (mut app App) v1_queue_job() web.Result { fn (mut app App) v1_queue_job() web.Result {
target_id := app.query['target'] or { target_id := app.query['target'] or {