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