lith 3 年之前
父节点
当前提交
5f6e490fac

+ 14 - 41
dotnet/Doc/DevOps/github/40.dotnet-publish.sh

@@ -1,7 +1,5 @@
 set -e
 
-# bash 30.nuget-build.sh
-
 
 #---------------------------------------------------------------------
 #(x.1)参数
@@ -9,55 +7,30 @@ args_="
 
 export codePath=/root/temp/svn/dotnet
 
- 
 # "
 
-
-export netVersion=netcoreapp2.1
  
 
-#----------------------------------------------
-echo "(x.2)dotnet-publish"
-echo "dotnet version: ${netVersion}"
-
-docker run -i --rm \
---env LANG=C.UTF-8 \
--v $codePath:/root/code \
-serset/dotnet:6.0-sdk \
-bash -c "
-
-echo 'publish Gateway'
-cd /root/code/Gateway/App.Gateway
-dotnet build --configuration Release
-dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gateway
-
-echo 'publish Gover'
-cd /root/code/ServiceCenter/App.Gover.Gateway
-dotnet build --configuration Release
-dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gover
+#---------------------------------------------- 
+echo "(x.2)publish netcoreapp2.1"
 
-echo 'publish ServiceCenter'
-cd /root/code/ServiceCenter/App.ServiceCenter
-dotnet build --configuration Release
-dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/ServiceCenter
+export netVersion=netcoreapp2.1 
+bash 41.dotnet-publish-by-netVersion.sh;
 
-echo 'publish Demo'
-cd /root/code/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo
-dotnet build --configuration Release
-dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Demo
 
-echo 'publish Robot'
-cd /root/code/ServiceStation/Demo/StressTest/App.Robot.Station
-dotnet build --configuration Release
-dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Robot
-     
-" 
 
 
-#----------------------------------------------
-echo "(x.3)dotnet-copy file"
+#---------------------------------------------- 
+echo "(x.3)publish net6.0"
 
+#修改csproj文件中的版本号为6.0
+cd $codePath
+sed -i 's/netcoreapp2.1/net6.0/g'  `grep -a 'netcoreapp2.1' . -rl --include *.csproj`
 
-cp $codePath
+export netVersion=net6.0
+bash 41.dotnet-publish-by-netVersion.sh;
 
 
+#修改csproj文件中的版本号为2.1
+cd $codePath
+sed -i 's/net6.0/netcoreapp2.1/g'  `grep -a 'net6.0' . -rl --include *.csproj`

+ 82 - 0
dotnet/Doc/DevOps/github/41.dotnet-publish-by-netVersion.sh

@@ -0,0 +1,82 @@
+set -e
+
+
+#---------------------------------------------------------------------
+#(x.1)参数
+args_="
+
+export codePath=/root/temp/svn/dotnet
+export netVersion=netcoreapp2.1 
+# "
+
+ 
+
+#----------------------------------------------
+echo "(x.2)dotnet-publish"
+echo "dotnet version: ${netVersion}"
+
+docker run -i --rm \
+--env LANG=C.UTF-8 \
+-v $codePath:/root/code \
+serset/dotnet:6.0-sdk \
+bash -c "
+set -e
+
+echo 'publish Gateway'
+cd /root/code/Gateway/App.Gateway
+dotnet build --configuration Release
+dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gateway
+
+echo 'publish Gover'
+cd /root/code/ServiceCenter/App.Gover.Gateway
+dotnet build --configuration Release
+dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gover
+
+echo 'publish ServiceCenter'
+cd /root/code/ServiceCenter/App.ServiceCenter
+dotnet build --configuration Release
+dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/ServiceCenter
+
+echo 'publish Demo'
+cd /root/code/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo
+dotnet build --configuration Release
+dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Demo
+
+echo 'publish Robot'
+cd /root/code/ServiceStation/Demo/StressTest/App.Robot.Station
+dotnet build --configuration Release
+dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Robot
+     
+" 
+
+
+#----------------------------------------------
+echo "(x.3)dotnet-copy file"
+
+echo "copy bat"
+cp -rf "$codePath/Doc/PublishFile/SersPublish/." "$codePath/Doc/Publish/SersPublish/$netVersion"
+
+
+echo "copy xml"
+targetFolder="$codePath/Doc/Publish/SersPublish/$netVersion"
+
+for file in "$codePath/ServiceCenter/App.ServiceCenter/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/ServiceCenter;done
+
+for file in "$codePath/ServiceStation/Demo/StressTest/App.Robot.Station/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/Robot;done
+
+for file in "$codePath/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/Demo;done
+
+
+
+
+
+
+
+
+echo 'publish succeed!'
+
+
+
+
+
+

+ 34 - 17
dotnet/Doc/DevOps/github/50.docker-build.sh

@@ -5,34 +5,51 @@ set -e
 #(x.1)参数
 args_="
 
-export codePath=/root/docker/jenkins/workspace/sqler/svn 
-
-
+export codePath=/root/docker/jenkins/workspace/sqler/svn
 
 export version=`grep '<Version>' ${codePath} -r --include *.csproj | grep -oP '>(.*)<' | tr -d '<>'`
 
-export name=sqler
-export projectPath=Sqler
-
 export DOCKER_USERNAME=serset
 export DOCKER_PASSWORD=xxx
 
 # "
 
  
-
+publishPath=${codePath}/dotnet/Doc/Publish
+netVersion=net6.0
 
 #---------------------------------------------------------------------
-echo "(x.2)dotnet-构建并发布项目文件"
-
-docker run -i --rm \
---env LANG=C.UTF-8 \
--v $codePath:/root/code \
-serset/dotnet:6.0-sdk \
-bash -c "
-cd '/root/code/$projectPath'
-dotnet build --configuration Release
-dotnet publish --configuration Release --output '/root/code/Publish/06.Docker/制作镜像/$name/app' " 
+echo "(x.2)dotnet-构建项目文件"
+
+echo "copy SersDocker
+cp -rf "$codePath/Doc/PublishFile/SersDocker/." "$codePath/Doc/Publish/SersDocker"
+
+echo "copy sers"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/ServiceCenter/appsettings.json" "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/ServiceCenter/." "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers/app"
+
+
+echo "copy sers-demo"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Demo/appsettings.json" "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-demo"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Demo/." "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-demo/app" 
+
+echo "copy sers-demo-robot"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Robot/appsettings.json" "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-demo-robot"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Robot/." "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-demo-robot/app"
+
+echo "copy sers-gateway"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Gateway/appsettings.json" "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-gateway"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Gateway/." "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-gateway/app"
+
+echo "copy sers-gover"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Gover/appsettings.json" "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-gover"
+cp -rf "$codePath/Doc/SersPublish/$netVersion/Gover/." "$codePath/Doc/Publish/SersDocker/docker部署Sers/sers-gover/app"
+
+
+echo "copy sers-demo-sersall" 
+xcopy  "Sers压测\sers压测-单体压测%netVersion%\ServiceCenter\appsettings.json" "SersDocker\docker部署Sers\sers-demo-sersall" 
+xcopy  "Sers压测\sers压测-单体压测%netVersion%\ServiceCenter" "SersDocker\docker制作镜像Sers\sers-demo-sersall\app" /e /i /r /y
+
 
 
 

+ 26 - 4
dotnet/Doc/DevOps/github/90.release-build.sh

@@ -7,12 +7,8 @@ args_="
 
 export codePath=/root/docker/jenkins/workspace/sqler/svn 
 
-
-
 export version=`grep '<Version>' ${codePath} -r --include *.csproj | grep -oP '>(.*)<' | tr -d '<>'`
 
-export name=sqler
-
 export export GIT_SSH_SECRET=xxxxxx
 
 # "
@@ -31,6 +27,32 @@ cp -rf  $codePath/Publish/06.Docker $codePath/Publish/release/06.Docker
 cp -rf  $codePath/Publish/06.Docker/制作镜像/${name}/app $codePath/Publish/release/04.服务站点/${name}
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 echo "(x.2.3)发布文件-压缩" 
 docker run --rm -i \
 -v $codePath/Publish:/root/file \

+ 5 - 23
dotnet/Doc/cmd/sers-publish(net6.0).bat

@@ -63,36 +63,18 @@ cd /d Doc\Publish
 :: 2 copy Sers Static
 
 ::(x.1)
-@echo "copy PublishFile"
+@echo "copy bat"
 xcopy  "..\PublishFile\SersPublish" "SersPublish\%netVersion%" /e /i /r /y
 
 
-::(x.2)ServiceCenter
-@echo "copy ServiceCenter wwwroot"
-xcopy  "..\..\ServiceCenter\App.Gover.Gateway\wwwroot" "SersPublish\%netVersion%\ServiceCenter\wwwroot" /e /i /r /y
-
-@echo "copy  xml of ServiceCenter"
+::(x.2)copy xml
+@echo "copy ServiceCenter xml "
 xcopy  "..\..\ServiceCenter\App.ServiceCenter\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\ServiceCenter" /i /r /y
 
-
-
-::(x.3)Gover
-@echo "copy Gover wwwroot"
-xcopy  "..\..\ServiceCenter\App.Gover.Gateway\wwwroot" "SersPublish\%netVersion%\Gover\wwwroot" /e /i /r /y
-
-
-
-::(x.4)Robot
-@echo "copy Robot wwwroot"
-xcopy  "..\..\ServiceStation\Demo\StressTest\App.Robot.Station\wwwroot" "SersPublish\%netVersion%\Robot\wwwroot" /e /i /r /y
- 
-@echo "copy  xml of Robot"
+@echo "copy Robot xml"
 xcopy  "..\..\ServiceStation\Demo\StressTest\App.Robot.Station\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\Robot" /i /r /y
 
-
- 
-::(x.5)
-@echo "copy  xml of Demo"
+@echo "copy Demo xml"
 xcopy  "..\..\ServiceStation\Demo\SersLoader\Did.SersLoader.Demo\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\Demo" /i /r /y
 
 

+ 5 - 23
dotnet/Doc/cmd/sers-publish(netcoreapp2.1).bat

@@ -62,36 +62,18 @@ cd /d Doc\Publish
 :: 2 copy Sers Static
 
 ::(x.1)
-@echo "copy PublishFile"
+@echo "copy bat"
 xcopy  "..\PublishFile\SersPublish" "SersPublish\%netVersion%" /e /i /r /y
 
 
-::(x.2)ServiceCenter
-@echo "copy ServiceCenter wwwroot"
-xcopy  "..\..\ServiceCenter\App.Gover.Gateway\wwwroot" "SersPublish\%netVersion%\ServiceCenter\wwwroot" /e /i /r /y
-
-@echo "copy  xml of ServiceCenter"
+::(x.2)copy xml
+@echo "copy ServiceCenter xml "
 xcopy  "..\..\ServiceCenter\App.ServiceCenter\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\ServiceCenter" /i /r /y
 
-
-
-::(x.3)Gover
-@echo "copy Gover wwwroot"
-xcopy  "..\..\ServiceCenter\App.Gover.Gateway\wwwroot" "SersPublish\%netVersion%\Gover\wwwroot" /e /i /r /y
-
-
-
-::(x.4)Robot
-@echo "copy Robot wwwroot"
-xcopy  "..\..\ServiceStation\Demo\StressTest\App.Robot.Station\wwwroot" "SersPublish\%netVersion%\Robot\wwwroot" /e /i /r /y
- 
-@echo "copy  xml of Robot"
+@echo "copy Robot xml"
 xcopy  "..\..\ServiceStation\Demo\StressTest\App.Robot.Station\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\Robot" /i /r /y
 
-
- 
-::(x.5)
-@echo "copy  xml of Demo"
+@echo "copy Demo xml"
 xcopy  "..\..\ServiceStation\Demo\SersLoader\Did.SersLoader.Demo\bin\Release\%netVersion%\*.xml" "SersPublish\%netVersion%\Demo" /i /r /y
 
 

+ 1 - 1
dotnet/ServiceCenter/App.ServiceCenter/App.ServiceCenter.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 
 	<PropertyGroup>
 		<OutputType>Exe</OutputType>