Enable watchtower to update itself

This commit is contained in:
Brian DeHamer 2015-07-20 22:54:18 +00:00
parent 1f460997cb
commit 3dd06cffb1
7 changed files with 254 additions and 35 deletions

View file

@ -20,6 +20,7 @@ func main() {
app := cli.NewApp()
app.Name = "watchtower"
app.Usage = "Automatically update running Docker containers"
app.Before = before
app.Action = start
app.Flags = []cli.Flag{
cli.IntFlag{
@ -46,6 +47,10 @@ func handleSignals() {
}()
}
func before(c *cli.Context) error {
return updater.CheckPrereqs()
}
func start(c *cli.Context) {
secs := time.Duration(c.Int("interval")) * time.Second