feat: update existing container in case of containerfile changes
This commit is contained in:
parent
4a5376eb43
commit
bff4422098
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user