command/build: add more logging

This commit is contained in:
Mitchell Hashimoto 2013-06-05 18:36:59 -07:00
parent d5cfa42e05
commit bfbc3e376c
1 changed files with 6 additions and 0 deletions

View File

@ -137,6 +137,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
log.Printf("Starting build run: %s", b.Name()) log.Printf("Starting build run: %s", b.Name())
artifacts[b.Name()] = b.Run(buildUis[b.Name()]) artifacts[b.Name()] = b.Run(buildUis[b.Name()])
log.Printf("Build finished: %s", b.Name())
}(b) }(b)
} }
@ -163,6 +164,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
log.Printf("Stopping build: %s", b.Name()) log.Printf("Stopping build: %s", b.Name())
b.Cancel() b.Cancel()
log.Printf("Build cancelled: %s", b.Name())
}(b) }(b)
} }
@ -171,8 +173,12 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Wait for both the builds to complete and the interrupt handler, // Wait for both the builds to complete and the interrupt handler,
// if it is interrupted. // if it is interrupted.
log.Printf("Waiting on builds to complete...")
wg.Wait() wg.Wait()
log.Printf("Builds completed. Waiting on interrupt barrier...")
interruptWg.Wait() interruptWg.Wait()
log.Printf("Interrupt barrier passed.")
if interrupted { if interrupted {
env.Ui().Say("Cleanly cancelled builds after being interrupted.") env.Ui().Say("Cleanly cancelled builds after being interrupted.")