fix: use SSH mode to install cmd agent + node
This commit is contained in:
@@ -1,31 +1,24 @@
|
||||
name: Install CMD Agent + Node.js on New Server
|
||||
name: Install CMD Agent + Node.js on New Server (via SSH)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- ops/downgrade-runners
|
||||
paths:
|
||||
- '.gitea/workflows/install-cmd-agent.yml'
|
||||
- 'scripts/install_cmd_agent.py'
|
||||
|
||||
jobs:
|
||||
install:
|
||||
runs-on: saas
|
||||
steps:
|
||||
- name: Download code
|
||||
- name: Install CMD Agent + Node.js via SSH
|
||||
shell: sh
|
||||
run: |
|
||||
set -eu
|
||||
archive_url="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
|
||||
mkdir -p repo
|
||||
curl -sL -H "Authorization: token ${GITHUB_TOKEN}" -o /tmp/repo.tar.gz "$archive_url"
|
||||
tar -xzf /tmp/repo.tar.gz --strip-components=1 -C repo
|
||||
rm -f /tmp/repo.tar.gz
|
||||
cd repo
|
||||
echo "代码下载完成,文件列表:"
|
||||
ls scripts/ | head -20
|
||||
|
||||
- name: Install CMD Agent + Node.js
|
||||
shell: sh
|
||||
run: |
|
||||
set -eu
|
||||
cd repo
|
||||
python3 scripts/install_cmd_agent.py
|
||||
# 下载脚本
|
||||
curl -sL -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/contents/scripts/install_cmd_agent.py?ref=ops/downgrade-runners" \
|
||||
| python3 -c "import json,sys,base64; d=json.load(sys.stdin); open('/tmp/install.py','w').write(base64.b64decode(d['content']).decode())"
|
||||
python3 /tmp/install.py
|
||||
|
||||
Reference in New Issue
Block a user