Compare commits

..

1 Commits

Author SHA1 Message Date
Jef Roosens aaef057347
WIP: check if build images exist
ci/woodpecker/pr/docs Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline failed Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/man Pipeline was successful Details
ci/woodpecker/pr/docker Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details
2022-12-16 14:33:16 +01:00
2 changed files with 5 additions and 6 deletions

View File

@ -83,7 +83,7 @@ pub fn (mut d AgentDaemon) run() {
// Make sure a recent build base image is available for
// building the config
if !d.images.up_to_date(config.base_image) {
d.linfo('Building builder image from base image $config.base_image')
d.linfo("Building builder image from base image $config.base_image")
// TODO handle this better than to just skip the config
d.images.refresh_image(config.base_image) or {

View File

@ -33,12 +33,11 @@ pub fn (m &ImageManager) get(base_image string) string {
return m.images[base_image].last()
}
// up_to_date returns whether the last known builder image is exists and is up
// to date. If this function returns true, the last builder image may be used
// to perform a build.
// outdated returns whether the last known builder image is exists and is up to
// date. If this function returns true, the last builder image may be used to
// perform a build.
pub fn (mut m ImageManager) up_to_date(base_image string) bool {
if base_image !in m.timestamps
|| m.timestamps[base_image].add_seconds(m.max_image_age) <= time.now() {
if base_image !in m.timestamps || m.timestamps[base_image].add_seconds(m.max_image_age) <= time.now() {
return false
}