ci(docker): 确保构建环境中curl可用
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 26s
Some checks failed
site-dist-deploy / build-and-deploy (push) Failing after 26s
添加对curl的检查与安装逻辑,以支持后续nvm安装脚本的执行
This commit is contained in:
parent
d687e47fdc
commit
8888382067
@ -40,6 +40,23 @@ jobs:
|
|||||||
- name: Build dist in Node container
|
- name: Build dist in Node container
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
# ensure curl available
|
||||||
|
if ! command -v curl >/dev/null 2>&1; then
|
||||||
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install -y curl ca-certificates
|
||||||
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
|
yum install -y curl ca-certificates
|
||||||
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
|
dnf install -y curl ca-certificates
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
apk add --no-cache curl ca-certificates
|
||||||
|
elif command -v zypper >/dev/null 2>&1; then
|
||||||
|
zypper install -y curl ca-certificates
|
||||||
|
else
|
||||||
|
echo "No known package manager found to install curl"; exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
if [ ! -d "$NVM_DIR" ]; then
|
if [ ! -d "$NVM_DIR" ]; then
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user