mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 16:59:34 +08:00
change: replace download url with aliyun oss
This commit is contained in:
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -29,3 +29,10 @@ jobs:
|
|||||||
binary_name: "hrp"
|
binary_name: "hrp"
|
||||||
ldflags: "-s -w"
|
ldflags: "-s -w"
|
||||||
extra_files: LICENSE README.md docs/CHANGELOG.md
|
extra_files: LICENSE README.md docs/CHANGELOG.md
|
||||||
|
- name: Upload to aliyun OSS
|
||||||
|
uses: manyuanrong/setup-ossutil@v2.0
|
||||||
|
with:
|
||||||
|
endpoint: "oss-cn-beijing.aliyuncs.com"
|
||||||
|
access-key-id: ${{ secrets.ALIYUN_ACCESSKEY_ID }}
|
||||||
|
access-key-secret: ${{ secrets.ALIYUN_ACCESSKEY_SECRET }}
|
||||||
|
- run: ossutil cp -rf cli/scripts/install.sh *.tar.gz *.zip oss://httprunner/
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ You can install `hrp` with one shell command, which will download the latest ver
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# install via curl
|
# install via curl
|
||||||
$ bash -c "$(curl -ksSL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh)"
|
$ bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||||
# install via wget
|
# install via wget
|
||||||
$ bash -c "$(wget https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh -O -)"
|
$ bash -c "$(wget https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh -O -)"
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are a golang developer, you can also install `hrp` with `go get`.
|
If you are a golang developer, you can also install `hrp` with `go get`.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# install hrp with one shell command
|
# install hrp with one shell command
|
||||||
# bash -c "$(curl -ksSL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh)"
|
# bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -24,6 +24,11 @@ function get_latest_version() {
|
|||||||
curl -sL https://github.com/httprunner/hrp/releases/latest | grep '<title>Release' | cut -d" " -f4
|
curl -sL https://github.com/httprunner/hrp/releases/latest | grep '<title>Release' | cut -d" " -f4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_os() {
|
||||||
|
os=$(uname -s)
|
||||||
|
echo "$os" | tr '[:upper:]' '[:lower:]'
|
||||||
|
}
|
||||||
|
|
||||||
function get_arch() {
|
function get_arch() {
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
if [ "$arch" == "x86_64" ]; then
|
if [ "$arch" == "x86_64" ]; then
|
||||||
@@ -32,16 +37,24 @@ function get_arch() {
|
|||||||
echo "$arch"
|
echo "$arch"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_download_url() {
|
||||||
|
# github
|
||||||
|
# url="https://github.com/httprunner/hrp/releases/download/$version/$1"
|
||||||
|
# aliyun oss
|
||||||
|
url="https://httprunner.oss-cn-beijing.aliyuncs.com/$1"
|
||||||
|
echo $url
|
||||||
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
echoInfo "Detect target hrp package..."
|
echoInfo "Detect target hrp package..."
|
||||||
version=$(get_latest_version)
|
version=$(get_latest_version)
|
||||||
echo "Latest version: $version"
|
echo "Latest version: $version"
|
||||||
os=$(uname -s)
|
os=$(get_os)
|
||||||
echo "Current OS: $os"
|
echo "Current OS: $os"
|
||||||
arch=$(get_arch)
|
arch=$(get_arch)
|
||||||
echo "Current ARCH: $arch"
|
echo "Current ARCH: $arch"
|
||||||
pkg="hrp-$version-$os-$arch.tar.gz"
|
pkg="hrp-$version-$os-$arch.tar.gz"
|
||||||
url="https://github.com/httprunner/hrp/releases/download/$version/$pkg"
|
url=$(get_download_url $pkg)
|
||||||
echo "Selected package: $url"
|
echo "Selected package: $url"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user