Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Dec 3, 2024
1 parent 54b86ef commit 1eed9c6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
4 changes: 2 additions & 2 deletions setup-runtime.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# setup runtime

```bash

curl -fSLo cacert.pem https://curl.se/ca/cacert.pem

curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/setup-coturn-runtime.sh?raw=true | bash
curl -fSL https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/setup-coturn-runtime.sh | bash -s -- --mirror china


curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/setup-socat-runtime.sh?raw=true | bash
curl -fSL https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/setup-socat-runtime.sh | bash -s -- --mirror china

curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/setup-socat-runtime.sh?raw=true | bash -s -- --version v2.2.1 --socat-version v1.8.0.1

curl -fSL https://github.com/jingjingxyk/swoole-cli/blob/new_dev/setup-nginx-runtime.sh?raw=true | bash
curl -fSL https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/setup-nginx-runtime.sh | bash -s -- --mirror china
Expand Down
47 changes: 32 additions & 15 deletions setup-socat-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case $OS in
;;
*)
case $OS in
'MSYS_NT'* | 'CYGWIN_NT'* )
'MSYS_NT'* | 'CYGWIN_NT'*)
OS="windows"
;;
'MINGW64_NT'*)
Expand All @@ -39,7 +39,7 @@ case $ARCH in
'x86_64')
ARCH="x64"
;;
'aarch64' | 'arm64' )
'aarch64' | 'arm64')
ARCH="arm64"
;;
*)
Expand All @@ -52,18 +52,6 @@ APP_VERSION='1.8.0.0'
APP_NAME='socat'
VERSION='v2.1.0'

mkdir -p bin/runtime
mkdir -p var/runtime

cd ${__PROJECT__}/var/runtime

APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-static-socat/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem"

if [ $OS = 'windows' ]; then
APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-static-socat/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip"
fi

MIRROR=''
while [ $# -gt 0 ]; do
case "$1" in
Expand All @@ -80,13 +68,43 @@ while [ $# -gt 0 ]; do
NO_PROXY="${NO_PROXY},.myqcloud.com,.swoole.com"
export NO_PROXY="${NO_PROXY},.tsinghua.edu.cn,.ustc.edu.cn,.npmmirror.com"
;;
--version)
# 指定发布 TAG
X_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}$')
if [[ -n $X_VERSION ]]; then
{
VERSION=$X_VERSION
}
fi
;;
--socat-version)
# 指定发布 TAG
X_APP_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}.\d{1,2}$')
if [[ -n $X_APP_VERSION ]]; then
{
APP_VERSION=$X_APP_VERSION
}
fi
;;
--*)
echo "Illegal option $1"
;;
esac
shift $(($# > 0 ? 1 : 0))
done

mkdir -p bin/runtime
mkdir -p var/runtime

cd ${__PROJECT__}/var/runtime

APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-static-socat/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
CACERT_DOWNLOAD_URL="https://curl.se/ca/cacert.pem"

if [ $OS = 'windows' ]; then
APP_DOWNLOAD_URL="https://github.com/jingjingxyk/build-static-socat/releases/download/${VERSION}/${APP_NAME}-${APP_VERSION}-vs2022-${ARCH}.zip"
fi

case "$MIRROR" in
china)
APP_DOWNLOAD_URL="https://php-cli.jingjingxyk.com/${APP_NAME}-${APP_VERSION}-${OS}-${ARCH}.tar.xz"
Expand Down Expand Up @@ -121,7 +139,6 @@ cd ${__PROJECT__}/var/runtime

cp -f ${__PROJECT__}/var/runtime/cacert.pem ${__PROJECT__}/bin/runtime/cacert.pem


cd ${__PROJECT__}/

set +x
Expand Down

0 comments on commit 1eed9c6

Please sign in to comment.