Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ type DeployCmd struct {

// DeployCmdFlags holds the possible down cmd flags
type DeployCmdFlags struct {
Namespace string
KubeContext string
Config string
DockerTarget string
CloudTarget string
SwitchContext bool
SkipBuild bool
GitBranch string
Namespace string
KubeContext string
Config string
ConfigOverwrite string
DockerTarget string
CloudTarget string
SwitchContext bool
SkipBuild bool
GitBranch string
}

func init() {
Expand Down Expand Up @@ -63,6 +64,7 @@ devspace deploy https://github.com/covexo/devspace --branch test
cobraCmd.Flags().StringVar(&cmd.flags.Namespace, "namespace", "", "The namespace to deploy to")
cobraCmd.Flags().StringVar(&cmd.flags.KubeContext, "kube-context", "", "The kubernetes context to use for deployment")
cobraCmd.Flags().StringVar(&cmd.flags.Config, "config", configutil.ConfigPath, "The devspace config file to load (default: '.devspace/config.yaml'")
cobraCmd.Flags().StringVar(&cmd.flags.ConfigOverwrite, "config-overwrite", configutil.OverwriteConfigPath, "The devspace config overwrite file to load (default: '.devspace/overwrite.yaml'")
cobraCmd.Flags().StringVar(&cmd.flags.DockerTarget, "docker-target", "", "The docker target to use for building")
cobraCmd.Flags().StringVar(&cmd.flags.CloudTarget, "cloud-target", "", "When using a cloud provider, the target to use")
cobraCmd.Flags().BoolVar(&cmd.flags.SwitchContext, "switch-context", false, "Switches the kube context to the deploy context")
Expand Down Expand Up @@ -164,6 +166,9 @@ func (cmd *DeployCmd) prepareConfig() {
// Don't use overwrite config if we use a different config
configutil.OverwriteConfigPath = ""
}
if configutil.OverwriteConfigPath != cmd.flags.ConfigOverwrite {
configutil.OverwriteConfigPath = cmd.flags.ConfigOverwrite
}

// Load Config and modify it
config := configutil.GetConfigWithoutDefaults()
Expand Down
6 changes: 6 additions & 0 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type UpCmdFlags struct {
labelSelector string
namespace string
config string
configOverwrite string
}

//UpFlagsDefault are the default flags for UpCmdFlags
Expand Down Expand Up @@ -98,6 +99,7 @@ Starts and connects your DevSpace:
cobraCmd.Flags().StringVarP(&cmd.flags.labelSelector, "label-selector", "l", "", "Comma separated key=value selector list (e.g. release=test)")
cobraCmd.Flags().StringVarP(&cmd.flags.namespace, "namespace", "n", "", "Namespace where to select pods")
cobraCmd.Flags().StringVar(&cmd.flags.config, "config", configutil.ConfigPath, "The devspace config file to load (default: '.devspace/config.yaml'")
cobraCmd.Flags().StringVar(&cmd.flags.configOverwrite, "config-overwrite", configutil.OverwriteConfigPath, "The devspace config overwrite file to load (default: '.devspace/overwrite.yaml'")
}

// Run executes the command logic
Expand All @@ -108,12 +110,16 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) {
// Don't use overwrite config if we use a different config
configutil.OverwriteConfigPath = ""
}
if configutil.OverwriteConfigPath != cmd.flags.configOverwrite {
configutil.OverwriteConfigPath = cmd.flags.configOverwrite
}

log.StartFileLogging()
var err error

configExists, _ := configutil.ConfigExists()
if !configExists {
log.Info("Config does not exist")
initFlags := &InitCmdFlags{
reconfigure: false,
overwrite: false,
Expand Down
16 changes: 5 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
package main

import (
"fmt"
"os"

"github.com/covexo/devspace/pkg/util/stdinutil"
"github.com/covexo/devspace/cmd"
"github.com/covexo/devspace/pkg/devspace/upgrade"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

var version string

func main() {
/*upgrade.SetVersion(version)
upgrade.SetVersion(version)

cmd.Execute()
os.Exit(0)*/
useDevSpaceCloud := *stdinutil.GetFromStdin(&stdinutil.GetFromStdinParams{
Question: "Do you want to use the DevSpace Cloud? (free ready-to-use Kubernetes) (yes | no)",
DefaultValue: "yes",
ValidationRegexPattern: "^(yes)|(no)$",
})

fmt.Println(useDevSpaceCloud)
os.Exit(0)
}
5 changes: 4 additions & 1 deletion pkg/devspace/config/configutil/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ generated.yaml
// DefaultConfigPath is the default config path to use
const DefaultConfigPath = "/.devspace/config.yaml"

// DefaultOverwriteConfigPath is the default overwrite config path to use
const DefaultOverwriteConfigPath = "/.devspace/overwrite.yaml"

// ConfigPath is the path for the main config
var ConfigPath = DefaultConfigPath

// OverwriteConfigPath specifies where the override.yaml lies
var OverwriteConfigPath = "/.devspace/overwrite.yaml"
var OverwriteConfigPath = DefaultOverwriteConfigPath

// DefaultDevspaceServiceName is the name of the initial default service
const DefaultDevspaceServiceName = "default"
Expand Down