This commit is contained in:
2023-03-10 11:42:12 +08:00
parent 9b9a8d1238
commit e262fc8719
2 changed files with 5 additions and 3 deletions
+5 -3
View File
@@ -11,10 +11,12 @@ cd ${app_path} && git pull
# 执行 go build 命令
cd ${app_path} && go build -o app
# 替换 app.service 文件中的 APP_PATH
sed -i "s|APP_PATH|${app_path}|g" app.service
cp app.service.example ${app_name}.service
cp app.service /etc/systemd/system/${app_name}.service
# 替换 app.service 文件中的 APP_PATH
sed -i "s|APP_PATH|${app_path}|g" ${app_name}.service
mv ${app_name}.service /etc/systemd/system/${app_name}.service
# 重新加载 systemd 配置文件
systemctl daemon-reload