fix: actually use path setting when building

This commit is contained in:
Jef Roosens 2022-12-16 20:38:26 +01:00
parent 894323ddcb
commit 402fef475a
8 changed files with 44 additions and 41 deletions

18
src/models/builds.v Normal file
View file

@ -0,0 +1,18 @@
module models
pub struct BuildConfig {
pub:
target_id int
kind string
url string
branch string
path string
repo string
base_image string
force bool
}
// str return a single-line string representation of a build log
pub fn (c BuildConfig) str() string {
return '{ target: $c.target_id, kind: $c.kind, url: $c.url, branch: $c.branch, path: $c.path, repo: $c.repo, base_image: $c.base_image, force: $c.force }'
}

View file

@ -52,6 +52,21 @@ pub fn (t &Target) str() string {
return str
}
// as_build_config converts a Target into a BuildConfig, given some extra
// needed information.
pub fn (t &Target) as_build_config(base_image string, force bool) BuildConfig {
return BuildConfig{
target_id: t.id
kind: t.kind
url: t.url
branch: t.branch
path: t.path
repo: t.repo
base_image: base_image
force: force
}
}
[params]
pub struct TargetFilter {
pub mut: