refactor(.woodpecker): 移除全局配置变量并优化SSH连接设置 移除了全局配置变量,改用YAML锚点引用方式统一管理SSH连接参数, 提高配置的可维护性并减少重复代码
This commit is contained in:
@@ -8,12 +8,6 @@ when:
|
||||
skip_clone: true
|
||||
|
||||
|
||||
# 全局配置变量(替换占位符即可使用)
|
||||
variables:
|
||||
SCREEN_NAME: "logic_service"
|
||||
REMOTE_EXE_DIR: "/opt/logic"
|
||||
JSON_CONFIG_URL: "https://你的JSON配置地址.com/deploy.json"
|
||||
LOG_PATH: "$HOME/run.log"
|
||||
|
||||
# 流水线核心步骤:理顺依赖链,确保各步骤依赖正确
|
||||
steps:
|
||||
@@ -128,10 +122,10 @@ steps:
|
||||
scp-exe-to-servers: # 与fetch-deploy-config同级,缩进2个空格
|
||||
image: appleboy/drone-scp:1.6.2 # 子元素,缩进4个空格
|
||||
settings: # 子元素,缩进4个空格
|
||||
host: 103.236.78.60 # settings内的项,缩进6个空格
|
||||
port: 29713
|
||||
username: root # 统一缩进6个空格
|
||||
password: dgaoXMPC8325 # 统一缩进6个空格
|
||||
host: &ssh_host 103.236.78.60
|
||||
port: &ssh_port 29713
|
||||
username: &ssh_user root
|
||||
password: &ssh_pass dgaoXMPC8325
|
||||
source:
|
||||
- blazing/build/**
|
||||
target: /opt/blazing/
|
||||
@@ -144,10 +138,10 @@ steps:
|
||||
image: appleboy/drone-ssh:1.6.2
|
||||
depends_on: [scp-exe-to-servers]
|
||||
settings: # 子元素,缩进4个空格
|
||||
host: 103.236.78.60 # settings内的项,缩进6个空格
|
||||
port: 29713
|
||||
username: root # 统一缩进6个空格
|
||||
password: dgaoXMPC8325 # 统一缩进6个空格
|
||||
host: *ssh_host
|
||||
port: *ssh_port
|
||||
username: *ssh_user
|
||||
password: *ssh_pass
|
||||
script:
|
||||
- |
|
||||
cd /opt/blazing/build
|
||||
|
||||
Reference in New Issue
Block a user