Skip to content

Commit

Permalink
Use current dir name to find out the plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Jun 22, 2019
1 parent b67ae68 commit d811a99
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"

"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -43,7 +44,9 @@ var pluginCmd = &cobra.Command{
api := fmt.Sprintf("%s/pluginManager/uploadPlugin", jenkinsRoot)

path, _ := os.Getwd()
path += "/target/alauda-devops-sync.hpi"
dirName := filepath.Base(path)
dirName = strings.Replace(dirName, "-plugin", "", 0)
path += fmt.Sprintf("/target/%s.hpi", dirName)
fmt.Println("target path", path)
extraParams := map[string]string{}
request, err := newfileUploadRequest(api, extraParams, "@name", path)
Expand Down

0 comments on commit d811a99

Please sign in to comment.