Skip to content

Commit

Permalink
introduce sync+exec watch action
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Nov 27, 2024
1 parent df253f2 commit b132107
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,9 @@
"properties": {
"ignore": {"type": "array", "items": {"type": "string"}},
"path": {"type": "string"},
"action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart"]},
"target": {"type": "string"}
"action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart", "sync+exec"]},
"target": {"type": "string"},
"exec": {"$ref": "#/definitions/service_hook"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
Expand Down
19 changes: 19 additions & 0 deletions types/derived.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions types/develop.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const (
WatchActionSync WatchAction = "sync"
WatchActionRebuild WatchAction = "rebuild"
WatchActionSyncRestart WatchAction = "sync+restart"
WatchActionSyncExec WatchAction = "sync+exec"
)

type Trigger struct {
Path string `yaml:"path" json:"path"`
Action WatchAction `yaml:"action" json:"action"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
Exec ServiceHook `yaml:"exec,omitempty" json:"exec,omitempty"`
Ignore []string `yaml:"ignore,omitempty" json:"ignore,omitempty"`
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
}
10 changes: 10 additions & 0 deletions types/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ func (m MappingWithEquals) RemoveEmpty() MappingWithEquals {
return m
}

func (m MappingWithEquals) ToMapping() Mapping {
o := Mapping{}
for k, v := range m {
if v != nil {
o[k] = *v
}
}
return o
}

func (m *MappingWithEquals) DecodeMapstructure(value interface{}) error {
switch v := value.(type) {
case map[string]interface{}:
Expand Down

0 comments on commit b132107

Please sign in to comment.