12 lines
746 B
Bash
Executable File
12 lines
746 B
Bash
Executable File
#!/usr/bin/env bash
|
||
# 依序執行部署的三個步驟:check-env → install-binary → activate。版本是必填的確切版本,不會去拿 @latest。
|
||
# .gitea/actions/deploy/run.sh <版本,例如 v0.4.9 或 v0.5.0-dev.2>
|
||
# 每個步驟都能單獨執行(見各檔案開頭),環境變數見 common.sh。CD 在沒有 git 的主機上用 curl 抓這個目錄的檔案再執行。
|
||
set -euo pipefail
|
||
dir=$(cd "$(dirname "$0")" && pwd)
|
||
version=${1:?用法:run.sh <版本,例如 v0.4.9>}
|
||
case "$version" in v[0-9]*.[0-9]*.[0-9]*) ;; *) echo "版本格式不對:$version(要像 v0.4.9 或 v0.5.0-dev.2)" >&2; exit 1 ;; esac
|
||
bash "$dir/check-env.sh"
|
||
bash "$dir/install-binary.sh" "$version"
|
||
bash "$dir/activate.sh" "$version"
|