Skip to content

Commit 812df2f

Browse files
committed
docs: add variables via cli box
1 parent 06f2af8 commit 812df2f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

docs/pages/configuration/variables/basics.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,20 @@ The `source` option of a config variable expects either:
9898
- [`input`](../../configuration/variables/source-input.mdx) means to ask the user a question **once** (values will be cached in `.devspace/generated.yaml`)
9999
:::
100100

101+
:::warning Pass Variables via CLI
102+
A useful feature in DevSpace is that you can also specify variables as flags, which will override previous values (if there are any):
103+
```
104+
devspace deploy --var VAR1=VALUE1 --var VAR2=VALUE2
105+
```
106+
:::
107+
101108
:::note Input Caching
102109
If `source` is either `all` or `input` and the variable is not defined, the user will be asked to provide a value either using a generic question or the one provided via the [`question` option](../../configuration/variables/source-input.mdx#question). The user-provided value will be cached in `.devspace/generated.yaml` and the user will only be asked again after the cache has been cleared first using:
103110
```bash
104111
devspace reset vars
105112
```
106113
:::
107114

108-
109-
110115
## Predefined Variables
111116
DevSpace provides some variables that are filled automatically and can be used within the config. These can be helpful for image tagging and other use cases:
112117

pkg/devspace/dependency/dependency_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dependency
22

33
import (
4+
"github.com/devspace-cloud/devspace/pkg/devspace/hook"
45
"io/ioutil"
56
"os"
67
"path/filepath"
@@ -333,6 +334,9 @@ func TestDeployAll(t *testing.T) {
333334
resolver: &fakeResolver{
334335
resolvedDependencies: testCase.resolvedDependencies,
335336
},
337+
hookExecuter: hook.NewExecuter(&latest.Config{
338+
Dependencies: testCase.dependencyTasks,
339+
}),
336340
}
337341

338342
err = manager.DeployAll(testCase.options)
@@ -579,6 +583,7 @@ type deployTestCase struct {
579583
forceDependencies bool
580584
skipBuild bool
581585
forceBuild bool
586+
skipDeploy bool
582587
forceDeploy bool
583588

584589
expectedErr string
@@ -672,7 +677,7 @@ func TestDeploy(t *testing.T) {
672677
}).Resolve(false)
673678
dependency := dependencies[0]
674679

675-
err = dependency.Deploy(testCase.skipPush, testCase.forceDependencies, testCase.skipBuild, testCase.forceBuild, testCase.forceDeploy, log.Discard)
680+
err = dependency.Deploy(testCase.skipPush, testCase.forceDependencies, testCase.skipBuild, testCase.forceBuild, testCase.skipDeploy, testCase.forceDeploy, log.Discard)
676681

677682
if testCase.expectedErr == "" {
678683
assert.NilError(t, err, "Error purging all in testCase %s", testCase.name)

0 commit comments

Comments
 (0)