Skip to content

Commit 9a9cc5d

Browse files
ndeloofglours
authored andcommitted
introduce sync+exec watch action
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent e3c0acf commit 9a9cc5d

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

schema/compose-spec.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,9 @@
500500
"properties": {
501501
"ignore": {"type": "array", "items": {"type": "string"}},
502502
"path": {"type": "string"},
503-
"action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart"]},
504-
"target": {"type": "string"}
503+
"action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart", "sync+exec"]},
504+
"target": {"type": "string"},
505+
"exec": {"$ref": "#/definitions/service_hook"}
505506
},
506507
"additionalProperties": false,
507508
"patternProperties": {"^x-": {}}

types/derived.gen.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/develop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ const (
2828
WatchActionSync WatchAction = "sync"
2929
WatchActionRebuild WatchAction = "rebuild"
3030
WatchActionSyncRestart WatchAction = "sync+restart"
31+
WatchActionSyncExec WatchAction = "sync+exec"
3132
)
3233

3334
type Trigger struct {
3435
Path string `yaml:"path" json:"path"`
3536
Action WatchAction `yaml:"action" json:"action"`
3637
Target string `yaml:"target,omitempty" json:"target,omitempty"`
38+
Exec ServiceHook `yaml:"exec,omitempty" json:"exec,omitempty"`
3739
Ignore []string `yaml:"ignore,omitempty" json:"ignore,omitempty"`
3840
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
3941
}

types/mapping.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ func (m MappingWithEquals) RemoveEmpty() MappingWithEquals {
7272
return m
7373
}
7474

75+
func (m MappingWithEquals) ToMapping() Mapping {
76+
o := Mapping{}
77+
for k, v := range m {
78+
if v != nil {
79+
o[k] = *v
80+
}
81+
}
82+
return o
83+
}
84+
7585
func (m *MappingWithEquals) DecodeMapstructure(value interface{}) error {
7686
switch v := value.(type) {
7787
case map[string]interface{}:

0 commit comments

Comments
 (0)