1
0

feat: update existing container in case of containerfile changes

This commit is contained in:
dump_stack() 2023-05-24 09:08:31 +00:00
parent 4a5376eb43
commit bff4422098
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -208,7 +208,16 @@ func (c Container) Build(image string, envs, runs []string) (err error) {
return
}
c.Log.Debug().Msg("generate")
if c.Exist() {
c.Log.Info().Msg("update")
err = os.WriteFile(cfile, []byte(cf), os.ModePerm)
if err != nil {
return
}
} else {
c.Log.Info().Msg("build")
}
output, err := c.build(cdir)
if err != nil {
@ -216,7 +225,7 @@ func (c Container) Build(image string, envs, runs []string) (err error) {
return
}
c.Log.Debug().Msg("success")
c.Log.Info().Msg("success")
return
}