Skip to content

Commit 9a11fcb

Browse files
gloursndeloof
authored andcommitted
make x-initialSync part of the spec as initial_sync attribute
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 0eb393d commit 9a11fcb

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

loader/loader_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,7 +3050,7 @@ services:
30503050
# sync static content
30513051
- path: ./webapp/html
30523052
action: sync
3053-
x-initialSync: true
3053+
initial_sync: true
30543054
target: /var/www
30553055
ignore:
30563056
- node_modules/
@@ -3082,13 +3082,11 @@ services:
30823082
assert.DeepEqual(t, *frontend.Develop, types.DevelopConfig{
30833083
Watch: []types.Trigger{
30843084
{
3085-
Path: "./webapp/html",
3086-
Action: types.WatchActionSync,
3087-
Target: "/var/www",
3088-
Ignore: []string{"node_modules/"},
3089-
Extensions: types.Extensions{
3090-
"x-initialSync": true,
3091-
},
3085+
Path: "./webapp/html",
3086+
Action: types.WatchActionSync,
3087+
Target: "/var/www",
3088+
Ignore: []string{"node_modules/"},
3089+
InitialSync: true,
30923090
},
30933091
},
30943092
})

schema/compose-spec.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,10 @@
992992
"exec": {
993993
"$ref": "#/definitions/service_hook",
994994
"description": "Command to execute when a change is detected and action is sync+exec."
995+
},
996+
"initial_sync": {
997+
"type": "boolean",
998+
"description": "Ensure that an initial synchronization is done before starting watch mode for sync+x triggers"
995999
}
9961000
},
9971001
"additionalProperties": false,

types/derived.gen.go

Lines changed: 1 addition & 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: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ const (
3333
)
3434

3535
type Trigger struct {
36-
Path string `yaml:"path" json:"path"`
37-
Action WatchAction `yaml:"action" json:"action"`
38-
Target string `yaml:"target,omitempty" json:"target,omitempty"`
39-
Exec ServiceHook `yaml:"exec,omitempty" json:"exec,omitempty"`
40-
Include []string `yaml:"include,omitempty" json:"include,omitempty"`
41-
Ignore []string `yaml:"ignore,omitempty" json:"ignore,omitempty"`
42-
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
36+
Path string `yaml:"path" json:"path"`
37+
Action WatchAction `yaml:"action" json:"action"`
38+
Target string `yaml:"target,omitempty" json:"target,omitempty"`
39+
Exec ServiceHook `yaml:"exec,omitempty" json:"exec,omitempty"`
40+
Include []string `yaml:"include,omitempty" json:"include,omitempty"`
41+
Ignore []string `yaml:"ignore,omitempty" json:"ignore,omitempty"`
42+
InitialSync bool `yaml:"initial_sync,omitempty" json:"initial_sync,omitempty"`
43+
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
4344
}

0 commit comments

Comments
 (0)