AntDeploy 是我开发一款开源一键发布插件
将本地 vs 中的代码,一键打包,部署到任意的远程服务器
部署方式支持 windows 服务,linux 服务,docker 容器,iis
支持增量发布(只更新有修改的)
支持一键回滚(出了问题快速恢复)
支持查看发布历史记录
AntDeploy 的代码托管地址
https://github.com/yuzd/AntDeploy
本章介绍如何使用 AntDeploy 一键部署到远程 linux 服务器作为服务运行
linux 服务器为 aws 的 ecs: 系统为 ubuntu18.04.4 (x64)
服务器上无安装 dotnet 环境(因为AntDeploy用的是独立部署)
第一步 安装 Linux 端 Agent
请在 qq 群(488312978)文件里面获取
把文件上传你的 linux 服务器
解压后有 3 个文件
AntAgent.service 是安装为服务的描述文件
AntDeployAgentLinuxService 执行文件
AntDeployAgentLinuxService.config 配置参数
按照下面更改 AntAgent.service 中的 WorkingDirectory 和 ExecStart
[Unit]
Description=AntAgent
[Service]
Type=notify
## WorkingDirectory 是上面的AntDeployAgentLinuxService 所在目录
WorkingDirectory=/home/ubuntu/download
## ExecStart 是AntDeployAgentLinuxService 执行文件的完整路径
ExecStart=/home/ubuntu/download/AntDeployAgentLinuxService
SyslogIdentifier=AntAgent
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
赋予这个可执行文件权限
chmod +x AntDeployAgentLinuxService
修改 agent 配置文件 AntDeployAgentLinuxService.config