Jenkins+.Net5+SVN自动部署

dotnet --version
#这里cd 后面的路径是想要编译的那个文件夹的路径
cd ./Admin.Core 
#dotnet的命令清除解决方案
dotnet clean
#dotnet的命令重新生成
dotnet build -o /tmp/dotnet/build/
#dotnet的发布
dotnet publish -r linux-x64 -c:Release -o ./bin/Release/net5.0/publish/ --self-contained false
rm -rf /home/wwwroot/Api/*
cp -rf ./bin/Release/net5.0/publish/* /home/wwwroot/Api
systemctl restart admin.service
systemctl status admin.service
dotnet clean
chown -R jenkins:jenkins /var/lib/jenkins
chown -R jenkins:jenkins /tmp/dotnet

权限不够直接换root

https://blog.csdn.net/weixin_43066287/article/details/106936914

总有一些人过着你想要的生活
原文地址:https://www.cnblogs.com/TTonly/p/14632791.html