mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 19:39:44 +08:00
refactor: get hrp version from aliyun OSS file
This commit is contained in:
3
.github/workflows/hrp-release.yml
vendored
3
.github/workflows/hrp-release.yml
vendored
@@ -42,7 +42,8 @@ jobs:
|
||||
access-key-secret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
|
||||
- name: Upload artifacts to aliyun OSS
|
||||
run: |
|
||||
ossutil cp -rf hrp/internal/version/VERSION oss://httprunner/
|
||||
ossutil cp -rf scripts/install.sh oss://httprunner/
|
||||
ossutil cp -rf ${{ env.ASSET_PATH }} oss://httprunner/
|
||||
- name: Test install.sh
|
||||
run: bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||
run: bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"
|
||||
|
||||
@@ -60,8 +60,6 @@ You can install HttpRunner via one curl command.
|
||||
|
||||
```bash
|
||||
$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"
|
||||
# backup
|
||||
$ bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||
```
|
||||
|
||||
Then you will get a `hrp` CLI tool.
|
||||
|
||||
@@ -53,8 +53,6 @@ HttpRunner 二进制命令行工具已上传至阿里云 OSS,在系统终端
|
||||
|
||||
```bash
|
||||
$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"
|
||||
# backup
|
||||
$ bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||
```
|
||||
|
||||
安装成功后,你将获得一个 `hrp` 命令行工具,执行 `hrp -h` 即可查看到参数帮助说明。
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
- feat: add builtin function `environ`/`ENV`
|
||||
- fix: demo function compatibility
|
||||
- change: get hrp version from aliyun OSS file when installing
|
||||
|
||||
## v4.0.0-beta (2022-04-24)
|
||||
|
||||
|
||||
1
hrp/internal/version/VERSION
Normal file
1
hrp/internal/version/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
v4.0.0-beta
|
||||
@@ -1,3 +1,8 @@
|
||||
package version
|
||||
|
||||
const VERSION = "v4.0.0-beta"
|
||||
import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
//go:embed VERSION
|
||||
var VERSION string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
__version__ = "4.0.0-beta"
|
||||
__version__ = "v4.0.0-beta"
|
||||
__description__ = "One-stop solution for HTTP(S) testing."
|
||||
|
||||
from httprunner.config import Config
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "httprunner"
|
||||
version = "4.0.0-beta"
|
||||
version = "v4.0.0-beta"
|
||||
description = "One-stop solution for HTTP(S) testing."
|
||||
license = "Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
@@ -16,11 +16,12 @@ if [ -z "$version" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "bump hrp version to $version"
|
||||
sed -i'.bak' "s/\".*\"/\"v$version\"/g" hrp/internal/version/init.go
|
||||
if [[ $version != v* ]]; then
|
||||
version="v$version"
|
||||
fi
|
||||
|
||||
echo "bump install.sh version to $version"
|
||||
sed -i'.bak' "s/LATEST_VERSION=\".*\"/LATEST_VERSION=\"v$version\"/g" scripts/install.sh
|
||||
echo "bump hrp version to $version"
|
||||
echo -n "$version" > hrp/internal/version/VERSION
|
||||
|
||||
echo "bump httprunner version to $version"
|
||||
sed -i'.bak' "s/__version__ = \".*\"/__version__ = \"$version\"/g" httprunner/__init__.py
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
# install hrp with one shell command
|
||||
# bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||
|
||||
LATEST_VERSION="v4.0.0-beta"
|
||||
# bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"
|
||||
|
||||
set -e
|
||||
|
||||
@@ -22,8 +20,7 @@ function echoWarn() {
|
||||
export -f echoError
|
||||
|
||||
function get_latest_version() {
|
||||
# <title>Release v0.4.0 · httprunner/hrp · GitHub</title>
|
||||
curl -sL https://github.com/httprunner/httprunner/releases/latest | grep '<title>Release' | cut -d" " -f4
|
||||
curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/VERSION
|
||||
}
|
||||
|
||||
function get_os() {
|
||||
@@ -61,7 +58,13 @@ function extract_pkg() {
|
||||
|
||||
function main() {
|
||||
echoInfo "Detect target hrp package..."
|
||||
version=$LATEST_VERSION
|
||||
version=$(get_latest_version)
|
||||
if [[ $version != v* ]]; then
|
||||
echo "get hrp latest version failed:"
|
||||
echo "$version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os=$(get_os)
|
||||
echo "Current OS: $os"
|
||||
arch=$(get_arch)
|
||||
|
||||
Reference in New Issue
Block a user