Przeglądaj źródła

revert CLI changes except folder path

Alexander Belanger 4 lat temu
rodzic
commit
40c7748d8d
4 zmienionych plików z 3 dodań i 19 usunięć
  1. 1 5
      cli/cmd/create.go
  2. 1 1
      cli/cmd/deploy.go
  3. 1 7
      cli/cmd/deploy/create.go
  4. 0 6
      cli/cmd/deploy/deploy.go

+ 1 - 5
cli/cmd/create.go

@@ -93,7 +93,7 @@ func init() {
 		"path",
 		"p",
 		"",
-		"if local build, the path to the build directory (default: Dockerfile directory)",
+		"if local build, the path to the build directory",
 	)
 
 	createCmd.PersistentFlags().StringVar(
@@ -164,10 +164,6 @@ func createFull(resp *api.AuthCheckResponse, client *api.Client, args []string)
 
 	color.New(color.FgGreen).Printf("Creating %s release: %s\n", args[0], name)
 
-	if localPath == "" {
-		localPath = filepath.Dir(dockerfile)
-	}
-
 	fullPath, err := filepath.Abs(localPath)
 
 	if err != nil {

+ 1 - 1
cli/cmd/deploy.go

@@ -235,7 +235,7 @@ func init() {
 		"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. (default: Dockerfile directory)",
+		"If local build, the path to the build directory. If remote build, the relative path from the repository root to the build directory.",
 	)
 
 	updateCmd.PersistentFlags().StringVarP(

+ 1 - 7
cli/cmd/deploy/create.go

@@ -280,13 +280,7 @@ func (c *CreateAgent) CreateFromDocker(
 	}
 
 	if opts.Method == DeployBuildTypeDocker {
-		basePath, err := filepath.Abs(".")
-
-		if err != nil {
-			return "", err
-		}
-
-		err = buildAgent.BuildDocker(agent, basePath, opts.LocalPath, opts.LocalDockerfile, "latest")
+		err = buildAgent.BuildDocker(agent, opts.LocalPath, opts.LocalPath, opts.LocalDockerfile, "latest")
 	} else {
 		err = buildAgent.BuildPack(agent, opts.LocalPath, "latest")
 	}

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

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