lith 4 år sedan
förälder
incheckning
da166bd480

+ 28 - 0
dotnet/Doc/DevOps/00.svn-checkout.sh

@@ -0,0 +1,28 @@
+set -e
+
+# cd /home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code/Sers/dotnet/Doc/DevOps; sh 00.svn-checkout.sh
+
+
+#(x.1)当前路径
+curWorkDir=$PWD
+curPath=$(dirname $0)
+
+cd $curPath/..
+basePath=$PWD
+# basePath=/home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers
+
+
+#(x.2)创建文件夹
+mkdir -p $basePath/code
+chmod 777 $basePath/code
+
+mkdir -p $basePath/nuget
+chmod 777 $basePath/nuget
+
+
+
+#(x.3)从svn拉取code
+docker run -it --rm -v $basePath/code:/root/svn serset/svn-client svn checkout svn://svn.sers.cloud/Sers2.1 /root/svn --username lith --password beyourself --no-auth-cache
+
+ 
+cd $curWorkDir

+ 29 - 0
dotnet/Doc/DevOps/01.svn-update.sh

@@ -0,0 +1,29 @@
+set -e
+
+# cd /home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code/Sers/dotnet/Doc/DevOps; sh 01.svn-update.sh
+
+
+#(x.1)当前路径
+curWorkDir=$PWD
+curPath=$(dirname $0)
+
+cd $curPath/../../../..
+codePath=$PWD
+# codePath=/home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code
+
+#(x.2)cleanup
+docker run -i --rm -v $codePath:/root/svn serset/svn-client svn cleanup /root/svn --remove-unversioned
+
+
+#(x.3)revert
+docker run -i --rm -v $codePath:/root/svn serset/svn-client svn revert /root/svn -R
+
+
+
+
+#(x.4)拉取最新代码
+docker run -i --rm -v $codePath:/root/svn serset/svn-client svn update /root/svn --username lith --password beyourself --no-auth-cache
+
+
+
+cd $curWorkDir

+ 42 - 0
dotnet/Doc/DevOps/10.changeVersion.sh

@@ -0,0 +1,42 @@
+set -e
+
+# cd /home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code/Sers/dotnet/Doc/DevOps; sh 10.changeVersion.sh
+
+
+#(x.1)当前路径
+curWorkDir=$PWD
+curPath=$(dirname $0)
+
+cd $curPath/../../../..
+codePath=$PWD 
+# codePath=/home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code
+
+
+echo "(x.2)get oldVersion"
+#oldVersion=1.1.0.53
+oldVersion=`grep '<Version>' Sers/dotnet/Library/Vit/Vit.Core/Vit.Core/Vit.Core.csproj | grep -o '[0-9\.]\+'`
+
+vs=(${oldVersion//./ }) 
+
+
+
+echo "(x.3)get newVersion"
+v4=`docker run -i --rm -v $codePath:/root/svn serset/svn-client svn info \
+| grep 'Rev:' | awk -v RS='\r\n' '{print $4}'` 
+ 
+newVersion=${vs[0]}.${vs[1]}.${vs[2]}.$v4 
+
+ 
+
+
+echo "(x.4)modify csproj"
+echo "$oldVersion -> $newVersion"
+cd $codePath/Sers/dotnet
+sed -i "s/$oldVersion/$newVersion/g" `grep -a $oldVersion . -rl --include *.csproj`
+
+
+
+
+cd $curWorkDir
+
+

+ 33 - 0
dotnet/Doc/DevOps/20.nuget-publish-main.sh

@@ -0,0 +1,33 @@
+set -e
+
+# cd /home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code/Sers/dotnet/Doc/DevOps; sh 20.nuget-publish-main.sh
+
+
+#(x.1)当前路径
+curWorkDir=$PWD
+curPath=$(dirname $0)
+
+cd $curPath/../../../../..
+basePath=$PWD
+ 
+# basePath=/home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace
+
+
+echo "(x.2)构建dotnet项目并发布"
+
+docker run -i --rm \
+--env LANG=C.UTF-8 \
+-v $basePath/code:/root/code \
+-v $basePath/nuget/packages:/root/.nuget/packages \
+serset/dotnet:6.0-sdk \
+sh /root/code/Sers/dotnet/Doc/DevOps/21.nuget-publish.sh 
+
+
+
+
+
+
+
+cd $curWorkDir
+
+

+ 7 - 0
dotnet/Doc/DevOps/21.nuget-publish.sh

@@ -0,0 +1,7 @@
+set -e
+
+cd '/root/code/Sers/dotnet/Library/Vit/Vit.Core/Vit.Core';
+dotnet build --configuration Release; 
+dotnet pack --configuration Release --output '/root/code/Sers/dotnet/Doc/Publish/nuget';
+
+

+ 42 - 0
dotnet/Doc/DevOps/99.jenkins.sh

@@ -0,0 +1,42 @@
+set -e
+
+
+# cd /home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code/Sers/dotnet/Doc/DevOps; sh 99.jenkins.sh
+
+
+
+
+#路径
+codePath=/home/DataStore/HDD/Data/008.jenkins/data/PersistentVolume/workspace/Sers/code
+
+
+
+
+#(x.1)svn-update
+
+echo '(x.1.1)svn-cleanup'
+chroot /host bash -c "docker run -i --rm -v $codePath:/root/svn serset/svn-client svn cleanup /root/svn --remove-unversioned"
+
+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"
+
+
+ 
+ 
+
+ 
+
+
+ 
+echo '(x.2)changeVersion'
+chroot /host bash -c "cd $codePath/Sers/dotnet/Doc/DevOps;sh 10.changeVersion.sh;"
+
+
+ 
+
+
+
+ 

+ 0 - 9
dotnet/Doc/PublishFile/bash/CGateway.bash

@@ -1,9 +0,0 @@
-
-cd   /root/app/CGateway
-
-while [ 1 -lt 2 ]
-do
-    echo "CGateway"
-    ./CGateway
-    sleep 1
-done

+ 0 - 9
dotnet/Doc/PublishFile/bash/Demo.bash

@@ -1,9 +0,0 @@
-
-cd   /root/app/Demo
-
-while [ 1 -lt 2 ]
-do
-    echo "dotnet Did.SersLoader.Demo.dll"
-    dotnet Did.SersLoader.Demo.dll
-    sleep 1
-done

+ 0 - 9
dotnet/Doc/PublishFile/bash/Gateway.bash

@@ -1,9 +0,0 @@
-
-cd   /root/app/Gateway
-
-while [ 1 -lt 2 ]
-do
-    echo "dotnet App.Gateway.dll"
-    dotnet App.Gateway.dll
-    sleep 1
-done

+ 0 - 9
dotnet/Doc/PublishFile/bash/Gover.bash

@@ -1,9 +0,0 @@
-
-cd   /root/app/Gover
-
-while [ 1 -lt 2 ]
-do
-    echo "dotnet App.Gover.Gateway.dll"
-    dotnet App.Gover.Gateway.dll
-    sleep 1
-done

+ 0 - 9
dotnet/Doc/PublishFile/bash/Robot.bash

@@ -1,9 +0,0 @@
-
-cd  /root/app/Robot
-
-while [ 1 -lt 2 ]
-do
-    echo "dotnet App.Robot.Station.dll"
-    dotnet App.Robot.Station.dll
-    sleep 1
-done

+ 0 - 9
dotnet/Doc/PublishFile/bash/ServiceCenter.bash

@@ -1,9 +0,0 @@
-
-cd   /root/app/ServiceCenter
-
-while [ 1 -lt 2 ]
-do
-    echo "dotnet App.ServiceCenter.dll"
-    dotnet App.ServiceCenter.dll
-    sleep 1
-done

+ 0 - 10
dotnet/Doc/PublishFile/bash/startall.bash

@@ -1,10 +0,0 @@
-sh ServiceCenter.bash > ServiceCenter.txt 2>&1 & 
-sleep 1
-
-sh Gateway.bash > Gateway.txt 2>&1 & 
-
-sh Gover.bash > Gover.txt 2>&1 & 
-
-sh Demo.bash > Demo.txt 2>&1 & 
-
-sh Robot.bash > Robot.txt 2>&1 & 

+ 0 - 23
dotnet/Doc/PublishFile/bash/startup.bash

@@ -1,23 +0,0 @@
-
-# run on back
-echo "start ServiceCenter.bash"
-chmod 777 /root/app/ServiceCenter.bash
-sh /root/app/ServiceCenter.bash > /root/app/ServiceCenter.log 2>&1 &
-
-
-# run on back
-echo "start Robot.bash"
-chmod 777 /root/app/Robot.bash
-sh /root/app/Robot.bash > /root/app/Robot.log 2>&1 &
-
-
-# run on front
-echo "start Demo.bash"
-chmod 777 /root/app/Demo.bash
-sh /root/app/Demo.bash > /root/app/Demo.log 
- 
-
-
-
-
-