forked from vieter-v/vieter
refactor: renamed cron & build code to use "target" naming
This commit is contained in:
parent
449656eb97
commit
5e11a91f3d
4 changed files with 51 additions and 48 deletions
|
|
@ -6,9 +6,9 @@ import os
|
|||
import build
|
||||
|
||||
// build locally builds the target with the given id.
|
||||
fn build(conf Config, repo_id int) ? {
|
||||
fn build(conf Config, target_id int) ? {
|
||||
c := client.new(conf.address, conf.api_key)
|
||||
repo := c.get_target(repo_id)?
|
||||
target := c.get_target(target_id)?
|
||||
|
||||
build_arch := os.uname().machine
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ fn build(conf Config, repo_id int) ? {
|
|||
image_id := build.create_build_image(conf.base_image)?
|
||||
|
||||
println('Running build...')
|
||||
res := build.build_repo(conf.address, conf.api_key, image_id, repo)?
|
||||
res := build.build_target(conf.address, conf.api_key, image_id, target)?
|
||||
|
||||
println('Removing build image...')
|
||||
|
||||
|
|
@ -29,6 +29,6 @@ fn build(conf Config, repo_id int) ? {
|
|||
dd.remove_image(image_id)?
|
||||
|
||||
println('Uploading logs to Vieter...')
|
||||
c.add_build_log(repo.id, res.start_time, res.end_time, build_arch, res.exit_code,
|
||||
c.add_build_log(target.id, res.start_time, res.end_time, build_arch, res.exit_code,
|
||||
res.logs)?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue