Skip to content

Commit d172e4c

Browse files
authored
Merge pull request #1257 from aFlyBird0/feat-apps-depends
feat: all tools from apps depend on origin tools
2 parents a702125 + 0429b86 commit d172e4c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

internal/pkg/configmanager/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ func (c *Config) getToolsWithVarsFromApp(a app) (Tools, error) {
7373
tools = append(tools, repoScaffoldingTool)
7474
}
7575

76+
// 5. all tools from apps should depend on the original tools,
77+
// because dtm will execute all original tools first, then execute all tools from apps
78+
for _, toolFromApps := range tools {
79+
for _, t := range c.Tools {
80+
toolFromApps.DependsOn = append(toolFromApps.DependsOn, t.KeyWithNameAndInstanceID())
81+
}
82+
}
83+
7684
log.Debugf("Have got %d tools from app %s.", len(tools), rawApp.Name)
7785
for i, t := range tools {
7886
log.Debugf("Tool %d: %v", i+1, t)

internal/pkg/configmanager/configmanager_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ var _ = Describe("LoadConfig", func() {
122122
InstanceID: "service-a",
123123
DependsOn: []string{
124124
"repo-scaffolding.service-a",
125+
"plugin1.default",
126+
"plugin2.tluafed",
125127
},
126128
Options: RawOptions{
127129
"instanceID": "service-a",
@@ -152,6 +154,8 @@ var _ = Describe("LoadConfig", func() {
152154
InstanceID: "service-a",
153155
DependsOn: []string{
154156
"repo-scaffolding.service-a",
157+
"plugin1.default",
158+
"plugin2.tluafed",
155159
},
156160
Options: RawOptions{
157161
"instanceID": "service-a",
@@ -184,7 +188,10 @@ var _ = Describe("LoadConfig", func() {
184188
tool5 := &Tool{
185189
Name: "repo-scaffolding",
186190
InstanceID: "service-a",
187-
DependsOn: []string{},
191+
DependsOn: []string{
192+
"plugin1.default",
193+
"plugin2.tluafed",
194+
},
188195
Options: RawOptions{
189196
"instanceID": "service-a",
190197
"destinationRepo": RawOptions{

0 commit comments

Comments
 (0)