mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Re-apply based on new go flags package (#336)
This commit is contained in:
parent
9eca883f17
commit
baf5e50051
7 changed files with 58 additions and 34 deletions
21
cmd/root.go
21
cmd/root.go
|
@ -1,17 +1,18 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/containrrr/watchtower/actions"
|
||||
"github.com/containrrr/watchtower/container"
|
||||
"github.com/containrrr/watchtower/internal/flags"
|
||||
"github.com/containrrr/watchtower/notifications"
|
||||
"github.com/robfig/cron"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -32,9 +33,9 @@ var (
|
|||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "watchtower",
|
||||
Short: "Automatically updates running Docker containers",
|
||||
Long: `
|
||||
Use: "watchtower",
|
||||
Short: "Automatically updates running Docker containers",
|
||||
Long: `
|
||||
Watchtower automatically updates running Docker containers whenever a new image is released.
|
||||
More information available at https://github.com/containrrr/watchtower/.
|
||||
`,
|
||||
|
@ -92,9 +93,11 @@ func PreRun(cmd *cobra.Command, args []string) {
|
|||
|
||||
noPull, _ := f.GetBool("no-pull")
|
||||
includeStopped, _ := f.GetBool("include-stopped")
|
||||
removeVolumes, _ := f.GetBool("remove-volumes")
|
||||
client = container.NewClient(
|
||||
!noPull,
|
||||
includeStopped,
|
||||
removeVolumes,
|
||||
)
|
||||
|
||||
notifier = notifications.NewNotifier(cmd)
|
||||
|
@ -176,5 +179,3 @@ func runUpdatesWithNotifications(filter container.Filter) {
|
|||
}
|
||||
notifier.SendNotification()
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue