Explorar o código

[cli] update command: set default build context to dockerfile directory

Anukul Sangwan %!s(int64=4) %!d(string=hai) anos
pai
achega
2a15e6e645
Modificáronse 2 ficheiros con 7 adicións e 1 borrados
  1. 1 1
      cli/cmd/deploy.go
  2. 6 0
      cli/cmd/deploy/deploy.go

+ 1 - 1
cli/cmd/deploy.go

@@ -234,7 +234,7 @@ func init() {
 		&localPath,
 		"path",
 		"p",
-		".",
+		"",
 		"If local build, the path to the build directory. If remote build, the relative path from the repository root to the build directory.",
 	)
 

+ 6 - 0
cli/cmd/deploy/deploy.go

@@ -133,6 +133,12 @@ func NewDeployAgent(client *api.Client, app string, opts *DeployOpts) (*DeployAg
 		deployAgent.imageRepo = release.GitActionConfig.ImageRepoURI
 	}
 
+	if deployAgent.opts.Method == DeployBuildTypeDocker {
+		if deployAgent.opts.LocalPath == "" {
+			deployAgent.opts.LocalPath = filepath.Dir(deployAgent.dockerfilePath)
+		}
+	}
+
 	deployAgent.tag = opts.OverrideTag
 
 	return deployAgent, nil