lith hace 3 años
padre
commit
7d92b861f6

+ 0 - 50
dotnet/Doc/DevOps/github/30.nuget-build.sh

@@ -1,50 +0,0 @@
-set -e
-
-# bash 30.nuget-build.sh
-
-
-#---------------------------------------------------------------------
-#(x.1)参数
-args_="
-
-export codePath=/root/docker/jenkins/workspace/sqler/svn 
-
-
-
-export version=`grep '<Version>' ${codePath} -r --include *.csproj | grep -oP '>(.*)<' | tr -d '<>'`
-
-export name=Vit.Ioc
-export projectPath=Vit.Ioc
-
-export NUGET_SERVER=https://api.nuget.org/v3/index.json
-export NUGET_KEY=xxxxxxxxxx
-
-# "
-
- 
- 
-
-
- 
-
-#----------------------------------------------
-echo "(x.2)nuget-构建包并推送到nuget server"
-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 pack --configuration Release --output '/root/code/Publish/nuget'
-
-# push to nuget server
-for file in /root/code/Publish/nuget/*.nupkg ; 
-do
-    echo nuget push \$file
-    dotnet nuget push \$file -k ${NUGET_KEY} -s ${NUGET_SERVER}
-done
-" 
-
-
-
-

+ 44 - 0
dotnet/Doc/DevOps/github/30.nuget-pack.sh

@@ -0,0 +1,44 @@
+set -e
+
+# bash 30.nuget-build.sh
+
+
+#---------------------------------------------------------------------
+#(x.1)参数
+args_="
+
+export codePath=/root/temp/svn
+
+export NUGET_SERVER=https://api.nuget.org/v3/index.json
+export NUGET_KEY=xxxxxxxxxx
+
+# "
+
+ 
+ 
+export nugetPath=dotnet/Doc/Publish/nuget
+
+ 
+
+#----------------------------------------------
+echo "(x.2)nuget-pack"
+docker run -i --rm \
+--env LANG=C.UTF-8 \
+-v $codePath:/root/code \
+serset/dotnet:6.0-sdk \
+bash -c "
+cd /root/code
+for file in \$(grep -a '<TargetFramework>netstandard2.0</TargetFramework>' . -rl --include *.csproj)
+do
+    if ! [[ \$file =~ (Apm|Empty|Temp|Zmq|SharedMemory|\\-) ]]; then
+        echo pack \$file
+        cd /root/code
+	cd \$(dirname \"\$file\")
+        dotnet build --configuration Release
+	dotnet pack --configuration Release --output '/root/code/$nugetPath'
+    fi
+done
+" 
+
+
+ 

+ 37 - 0
dotnet/Doc/DevOps/github/31.nuget-push.sh

@@ -0,0 +1,37 @@
+set -e
+
+
+
+#---------------------------------------------------------------------
+#(x.1)参数
+args_="
+
+export codePath=/root/temp/svn
+
+export NUGET_SERVER=https://api.nuget.org/v3/index.json
+export NUGET_KEY=xxxxxxxxxx
+
+# "
+
+ 
+ 
+export nugetPath=dotnet/Doc/Publish/nuget
+
+ 
+
+#----------------------------------------------
+echo "(x.2)nuget-pack"
+docker run -i --rm \
+--env LANG=C.UTF-8 \
+-v $codePath:/root/code \
+serset/dotnet:6.0-sdk \
+bash -c "
+for file in /root/code/$nugetPath/*.nupkg
+do
+    echo nuget push \$file
+    dotnet nuget push \$file -k ${NUGET_KEY} -s ${NUGET_SERVER}
+done
+" 
+
+
+ 

+ 63 - 0
dotnet/Doc/DevOps/github/40.dotnet-publish.sh

@@ -0,0 +1,63 @@
+set -e
+
+# bash 30.nuget-build.sh
+
+
+#---------------------------------------------------------------------
+#(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 "
+
+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"
+
+
+cp $codePath
+
+

+ 0 - 0
dotnet/Doc/DevOps/github/20.docker-build.sh → dotnet/Doc/DevOps/github/50.docker-build.sh


+ 1 - 1
dotnet/Doc/DevOps/github/startup.sh

@@ -28,7 +28,7 @@ export projectPath=Sqler
 
 #----------------------------------------------
 echo "(x.2)get version" 
-export version=`grep '<Version>' ${codePath} -r --include *.csproj | grep -oP '>(.*)<' | tr -d '<>'`
+export version=`grep '<Version>' ${codePath} -r --include Sers.Core.csproj | grep -oP '>(.*)<' | tr -d '<>'`
 # echo $version
 
 

+ 3 - 1
dotnet/Doc/DevOps/k8s/99.jenkins.sh

@@ -21,7 +21,9 @@ echo '(x.1.2)svn-revert'
 chroot /host bash -c "docker run -i --rm -v $codePath:/root/svn serset/svn-client svn revert /root/svn -R"
 
 echo '(x.1.3)svn-update'
-chroot /host bash -c "docker run -i --rm -v $codePath:/root/svn serset/svn-client svn update /root/svn --username lith --password beyourself --no-auth-cache"
+# svnUser=lith
+# svnPwd=pwd
+chroot /host bash -c "docker run -i --rm -v $codePath:/root/svn serset/svn-client svn update /root/svn --username $svnUser --password $svnPwd --no-auth-cache"
 
 
  

+ 24 - 10
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>
@@ -9,18 +9,17 @@
 
 
 	<ItemGroup>
-	  <Content Include="appsettings.json">
-	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-	  </Content>
+		<Content Include="appsettings.json">
+			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+		</Content>
 
-	  <Content Include="contentTypeMap.json">
-	    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-	  </Content>
+		<Content Include="contentTypeMap.json">
+			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+		</Content>
 	</ItemGroup>
 
 	<ItemGroup>
 		<PackageReference Include="Microsoft.AspNetCore.App" />
-		
 		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Ipc\Sers.CL.Ipc.SharedMemory\Sers.CL.Ipc.SharedMemory.csproj" />
 		<ProjectReference Include="..\..\Library\Sers\Sers.CL\WebSocket\Sers.CL.WebSocket\Sers.CL.WebSocket.csproj" />
 		<ProjectReference Include="..\..\Library\Sers\Sers.CL\Zmq\FullDuplex\Sers.CL.Zmq.FullDuplex\Sers.CL.Zmq.FullDuplex.csproj" />
@@ -31,8 +30,23 @@
 	</ItemGroup>
 
 
-	<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
+
+	<ItemGroup>
+		<Content Include="..\App.Gover.Gateway\wwwroot\**">
+			<Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
+			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+		</Content>
+	</ItemGroup>
+
+	<!--<ItemGroup>
+		<Content Include="..\App.Gover.Gateway\**">
+			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+		</Content>
+		<Content Remove="..\App.Gover.Gateway\App.Gover.Gateway.csproj" />
+	</ItemGroup>-->
+
+	<!--<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
 		<Exec Command="xcopy  &quot;$(ProjectDir)..\App.Gover.Gateway\wwwroot&quot; &quot;$(TargetDir)\wwwroot&quot; /e /i /r /y" />
-	</Target>
+	</Target>-->
 
 </Project>