Skip to content

Commit 733b68e

Browse files
committed
refactor: fix --from-file & rename run_dependency_pipelines
1 parent eae0359 commit 733b68e

12 files changed

Lines changed: 23 additions & 20 deletions

File tree

cmd/init.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,15 @@ echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,
443443

444444
// Add pipeline: dev
445445
config.Pipelines["dev"] = &latest.Pipeline{
446-
Run: `run_dependency_pipelines --all # 1. Deploy any projects this project needs (see "dependencies")
447-
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
446+
Run: `
447+
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
448+
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
448449
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
449450
}
450451

451452
// Add pipeline: dev
452453
config.Pipelines["deploy"] = &latest.Pipeline{
453-
Run: `run_dependency_pipelines --all # 1. Deploy any projects this project needs (see "dependencies")
454+
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
454455
build_images --all -t $(git describe --always) # 2. Build, tag (git commit hash) and push all images (see "images")
455456
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"`,
456457
}

e2e/tests/dependencies/testdata/git/devspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ dependencies:
1515
pipelines:
1616
dev:
1717
run: |-
18-
run_dependency_pipelines dependency
19-
run_dependency_pipelines dependency-deploy > dependency.txt
18+
run_dependencies dependency
19+
run_dependencies dependency-deploy > dependency.txt
2020
dep-test > imports.txt

e2e/tests/dependencies/testdata/wait/dep1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
pipelines:
99
deploy: |-
10-
run_dependency_pipelines --all
10+
run_dependencies --all
1111
# We use dep2 here because we don't know if dep1 or dep2 finishs first
1212
echo "dep2" >> out.txt
1313

e2e/tests/dependencies/testdata/wait/dep2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ dependencies:
77

88
pipelines:
99
deploy: |-
10-
run_dependency_pipelines --all
10+
run_dependencies --all
1111
echo "dep2" >> out.txt
1212

e2e/tests/dependencies/testdata/wait/devspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ dependencies:
99

1010
pipelines:
1111
dev: |-
12-
run_dependency_pipelines --all
12+
run_dependencies --all
1313
echo "wait" >> out.txt
1414

e2e/tests/imports/testdata/local/devspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pipelines:
2222
echo ${devspace.name} > name.txt
2323
echo ${DEVSPACE_TMPDIR} > temp.txt
2424
25-
run_dependency_pipelines --all > dependency.txt
25+
run_dependencies --all > dependency.txt
2626
2727
run_pipelines import1 > import1.txt
2828
run_pipelines import2 > import2.txt

pkg/devspace/config/versions/v1beta11/upgrade.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ func (c *Config) Upgrade(log log.Logger) (config.Config, error) {
163163
}
164164

165165
if !dep.Disabled {
166-
deployPipeline += "run_dependency_pipelines " + name + "\n"
167-
buildPipeline += "run_dependency_pipelines " + name + " --pipeline build\n"
168-
purgePipeline += "run_dependency_pipelines " + name + " --pipeline purge\n"
166+
deployPipeline += "run_dependencies " + name + "\n"
167+
buildPipeline += "run_dependencies " + name + " --pipeline build\n"
168+
purgePipeline += "run_dependencies " + name + " --pipeline purge\n"
169169
}
170170
}
171171

pkg/devspace/pipeline/engine/pipelinehandler/commands/create_deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func CreateDeployments(ctx devspacecontext.Context, pipeline types.Pipeline, arg
7474
}
7575

7676
func applySetValues(ctx devspacecontext.Context, name, objName string, set, setString, from, fromFiles []string) (devspacecontext.Context, error) {
77-
if len(set) == 0 && len(setString) == 0 && len(from) == 0 {
77+
if len(set) == 0 && len(setString) == 0 && len(from) == 0 && len(fromFiles) == 0 {
7878
return ctx, nil
7979
}
8080

pkg/devspace/pipeline/engine/pipelinehandler/commands/run_dependency_pipelines.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type RunDependencyPipelinesOptions struct {
1919
}
2020

2121
func RunDependencyPipelines(ctx devspacecontext.Context, pipeline types.Pipeline, args []string) error {
22-
ctx.Log().Debugf("run_dependency_pipelines %s", strings.Join(args, " "))
22+
ctx.Log().Debugf("run_dependencies %s", strings.Join(args, " "))
2323
err := pipeline.Exclude(ctx)
2424
if err != nil {
2525
return err
@@ -57,7 +57,7 @@ func RunDependencyPipelines(ctx devspacecontext.Context, pipeline types.Pipeline
5757
}
5858
}
5959
} else {
60-
return fmt.Errorf("either specify 'run_dependency_pipelines --all' or 'run_dependency_pipelines dep1 dep2'")
60+
return fmt.Errorf("either specify 'run_dependencies --all' or 'run_dependencies dep1 dep2'")
6161
}
6262

6363
// run hooks & deploy dependencies

pkg/devspace/pipeline/engine/pipelinehandler/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ var PipelineCommands = map[string]func(devCtx devspacecontext.Context, pipeline
5757
"stop_dev": func(devCtx devspacecontext.Context, pipeline types.Pipeline, args []string) error {
5858
return commands.StopDev(devCtx, pipeline, args)
5959
},
60+
"run_dependencies": func(devCtx devspacecontext.Context, pipeline types.Pipeline, args []string) error {
61+
return commands.RunDependencyPipelines(devCtx, pipeline, args)
62+
},
6063
"run_dependency_pipelines": func(devCtx devspacecontext.Context, pipeline types.Pipeline, args []string) error {
6164
return commands.RunDependencyPipelines(devCtx, pipeline, args)
6265
},

0 commit comments

Comments
 (0)