提交 d811a997 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Use current dir name to find out the plugin name

上级 b67ae689
......@@ -10,6 +10,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/viper"
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册