mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-08 22:13:13 +08:00
bump version to v0.5.3
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# install hrp with one shell command
|
# install hrp with one shell command
|
||||||
# bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
# bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||||
|
|
||||||
LATEST_VERSION="v0.5.2"
|
LATEST_VERSION="v0.5.3"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
## v0.5.3 (2022-01-20)
|
## v0.5.3 (2022-01-25)
|
||||||
|
|
||||||
- change: download package assets from aliyun OSS
|
- change: download package assets from aliyun OSS
|
||||||
- fix: disable color logging on Windows
|
- fix: disable color logging on Windows
|
||||||
|
- fix: print stderr when exec command failed
|
||||||
|
- fix: build hashicorp plugin failed when creating scaffold
|
||||||
|
|
||||||
## v0.5.2 (2022-01-19)
|
## v0.5.2 (2022-01-19)
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/httprunner/hrp/internal/ga"
|
"github.com/httprunner/hrp/internal/ga"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@@ -37,7 +38,8 @@ func CreateScaffold(projectName string) error {
|
|||||||
if err := createFolder(path.Join(projectName, "testcases")); err != nil {
|
if err := createFolder(path.Join(projectName, "testcases")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := createFolder(path.Join(projectName, "plugin")); err != nil {
|
pluginDir := path.Join(projectName, "plugin")
|
||||||
|
if err := createFolder(pluginDir); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := createFolder(path.Join(projectName, "reports")); err != nil {
|
if err := createFolder(path.Join(projectName, "reports")); err != nil {
|
||||||
@@ -58,15 +60,19 @@ func CreateScaffold(projectName string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create debugtalk.go
|
// create debugtalk.go
|
||||||
pluginFile := path.Join(projectName, "plugin", "debugtalk.go")
|
pluginFile := path.Join(pluginDir, "debugtalk.go")
|
||||||
if err := createFile(pluginFile, demoPlugin); err != nil {
|
if err := createFile(pluginFile, demoPlugin); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
cmd := exec.Command("go", "build",
|
|
||||||
"-o", path.Join(projectName, "debugtalk.bin"),
|
// download plugin dependency
|
||||||
pluginFile)
|
if err := execCommand(exec.Command("go", "get", "github.com/httprunner/hrp/plugin"), pluginDir); err != nil {
|
||||||
if err := cmd.Run(); err != nil {
|
return err
|
||||||
log.Error().Err(err).Msg("build plugin debugtalk.bin failed")
|
}
|
||||||
|
|
||||||
|
// build plugin debugtalk.bin
|
||||||
|
if err := execCommand(exec.Command("go", "build", "-o", path.Join("..", "debugtalk.bin"), "debugtalk.go"), pluginDir); err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// create .gitignore
|
// create .gitignore
|
||||||
@@ -81,6 +87,19 @@ func CreateScaffold(projectName string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func execCommand(cmd *exec.Cmd, cwd string) error {
|
||||||
|
log.Info().Str("cmd", cmd.String()).Str("cwd", cwd).Msg("exec command")
|
||||||
|
cmd.Dir = cwd
|
||||||
|
output, err := cmd.CombinedOutput()
|
||||||
|
out := strings.TrimSpace(string(output))
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Str("output", out).Msg("exec command failed")
|
||||||
|
} else if len(out) != 0 {
|
||||||
|
log.Info().Str("output", out).Msg("exec command success")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func createFolder(folderPath string) error {
|
func createFolder(folderPath string) error {
|
||||||
log.Info().Str("path", folderPath).Msg("create folder")
|
log.Info().Str("path", folderPath).Msg("create folder")
|
||||||
err := os.MkdirAll(folderPath, os.ModePerm)
|
err := os.MkdirAll(folderPath, os.ModePerm)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
const VERSION = "v0.5.2"
|
const VERSION = "v0.5.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user