mrutkows commented on a change in pull request #310: Support both manifest.yaml 
and manifest.yml
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/310#discussion_r133324203
 
 

 ##########
 File path: cmd/root.go
 ##########
 @@ -144,3 +138,134 @@ func initConfig() {
                fmt.Println("Using config file:", viper.ConfigFileUsed())
        }
 }
+
+
+func Deploy() error {
+
+       whisk.SetVerbose(utils.Flags.Verbose)
+
+       projectPath, err := filepath.Abs(utils.Flags.ProjectPath)
+       utils.Check(err)
+
+       if utils.Flags.ManifestPath == "" {
+               if _, err := os.Stat(path.Join(projectPath, "manifest.yaml")); 
err == nil {
+                       utils.Flags.ManifestPath = path.Join(projectPath, 
deployers.ManifestFileNameYaml)
+               } else if _, err := os.Stat(path.Join(projectPath, 
"manifest.yml")); err == nil {
+                       utils.Flags.ManifestPath = path.Join(projectPath, 
deployers.ManifestFileNameYml)
+               }
+       }
+
+       if utils.Flags.DeploymentPath == "" {
+               if _, err := os.Stat(path.Join(projectPath, 
"deployment.yaml")); err == nil {
+                       utils.Flags.DeploymentPath = path.Join(projectPath, 
deployers.DeploymentFileNameYaml)
+               } else if _, err := os.Stat(path.Join(projectPath, 
"deployment.yml")); err == nil {
+                       utils.Flags.DeploymentPath = path.Join(projectPath, 
deployers.DeploymentFileNameYml)
+               }
+       }
+
+       if utils.MayExists(utils.Flags.ManifestPath) {
 
 Review comment:
   @lzbj we need to add testcases to test for the "-p" parameter for a package 
with 
   1) only a manifest.yaml (and .yml)
   2) a manifest.yaml and deployment.yml (both)
   3) mix of .yaml / .yml combinations
   and automate in travis.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to