Skip to content

Commit 4afb43c

Browse files
ndeloofglours
authored andcommitted
introduce restart watch action
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 9a9cc5d commit 4afb43c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

loader/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func checkConsistency(project *types.Project) error {
155155

156156
if s.Develop != nil && s.Develop.Watch != nil {
157157
for _, watch := range s.Develop.Watch {
158-
if watch.Action != types.WatchActionRebuild && watch.Target == "" {
158+
if watch.Target == "" && watch.Action != types.WatchActionRebuild && watch.Action != types.WatchActionRestart {
159159
return fmt.Errorf("services.%s.develop.watch: target is required for non-rebuild actions: %w", s.Name, errdefs.ErrInvalid)
160160
}
161161
}

schema/compose-spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@
500500
"properties": {
501501
"ignore": {"type": "array", "items": {"type": "string"}},
502502
"path": {"type": "string"},
503-
"action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart", "sync+exec"]},
503+
"action": {"type": "string", "enum": ["rebuild", "sync", "restart", "sync+restart", "sync+exec"]},
504504
"target": {"type": "string"},
505505
"exec": {"$ref": "#/definitions/service_hook"}
506506
},

types/develop.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type WatchAction string
2727
const (
2828
WatchActionSync WatchAction = "sync"
2929
WatchActionRebuild WatchAction = "rebuild"
30+
WatchActionRestart WatchAction = "restart"
3031
WatchActionSyncRestart WatchAction = "sync+restart"
3132
WatchActionSyncExec WatchAction = "sync+exec"
3233
)

0 commit comments

Comments
 (0)