mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-23 07:28:57 +01:00
cmd: run: flag for running jobs only once
This commit is contained in:
parent
4f86fa8332
commit
2c50c8fd63
@ -105,6 +105,10 @@ func main() {
|
||||
Action: cmdRun,
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{Name: "job"},
|
||||
cli.BoolFlag{
|
||||
Name: "once",
|
||||
Usage: "run jobs only once, regardless of configured repeat behavior",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -192,9 +196,13 @@ func cmdRun(c *cli.Context) error {
|
||||
}
|
||||
|
||||
for _, j := range jobs {
|
||||
if c.IsSet("once") {
|
||||
j.RepeatStrategy = jobrun.NoRepeatStrategy{}
|
||||
}
|
||||
if c.IsSet("job") {
|
||||
if c.String("job") == j.Name {
|
||||
runner.AddJob(j)
|
||||
break
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user