|
@@ -1,76 +1,74 @@
|
|
|
-set -e
|
|
|
-
|
|
|
-
|
|
|
-#---------------------------------------------------------------------
|
|
|
-#(x.1)参数
|
|
|
-args_="
|
|
|
-
|
|
|
-export basePath=/root/temp/svn
|
|
|
-export NUGET_PATH=$basePath/Publish/release/.nuget
|
|
|
-
|
|
|
-# "
|
|
|
-
|
|
|
-if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
|
|
|
-
|
|
|
-
|
|
|
-#----------------------------------------------
|
|
|
-echo "(x.2)获取netVersion"
|
|
|
-netVersion=`grep '<TargetFramework>' $(grep '<publish>' ${basePath} -r --include *.csproj -l | head -n 1) | grep -oP '>(.*)<' | tr -d '<>'`
|
|
|
-
|
|
|
-
|
|
|
-publishPath=$basePath/Publish/release/release/Station\($netVersion\)
|
|
|
-echo publish Station
|
|
|
-echo dotnet version: $netVersion
|
|
|
-
|
|
|
-
|
|
|
-#----------------------------------------------
|
|
|
-echo "(x.3)查找所有需要发布的项目并发布"
|
|
|
-
|
|
|
-
|
|
|
-mkdir -p $publishPath
|
|
|
-
|
|
|
-docker run -i --rm \
|
|
|
---env LANG=C.UTF-8 \
|
|
|
--v $NUGET_PATH:/root/.nuget \
|
|
|
--v $basePath:/root/code \
|
|
|
-serset/dotnet:sdk-6.0 \
|
|
|
-bash -c "
|
|
|
-set -e
|
|
|
-
|
|
|
-basePath=/root/code
|
|
|
-publishPath=\$basePath/Publish/release/release/Station\($netVersion\)
|
|
|
-
|
|
|
-#(x.3)查找所有需要发布的项目并发布
|
|
|
-cd \$basePath
|
|
|
-for file in \$(grep -a '<publish>' . -rl --include *.csproj)
|
|
|
-do
|
|
|
- cd \$basePath
|
|
|
-
|
|
|
- #get publishName
|
|
|
- publishName=\`grep '<publish>' \$file -r | grep -oP '>(.*)<' | tr -d '<>'\`
|
|
|
-
|
|
|
- echo publish \$publishName
|
|
|
-
|
|
|
- #publish
|
|
|
- cd \$(dirname \"\$file\")
|
|
|
- dotnet build --configuration Release
|
|
|
- dotnet publish --configuration Release --output \"\$publishPath/\$publishName\"
|
|
|
-
|
|
|
- #copy xml
|
|
|
- for filePath in bin/Release/$netVersion/*.xml ; do \\cp -rf \$filePath \"\$publishPath/\$publishName\";done
|
|
|
-done
|
|
|
-
|
|
|
-
|
|
|
-#(x.4)copy dir
|
|
|
-\cp -rf \$basePath/Publish/ReleaseFile/Station/. \"\$publishPath\"
|
|
|
-
|
|
|
-"
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-echo 'publish succeed!'
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+set -e
|
|
|
+
|
|
|
+
|
|
|
+#---------------------------------------------------------------------
|
|
|
+# args
|
|
|
+args_="
|
|
|
+
|
|
|
+export basePath=/root/temp/svn
|
|
|
+export NUGET_PATH=$basePath/Publish/release/.nuget
|
|
|
+
|
|
|
+# "
|
|
|
+
|
|
|
+if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
|
|
|
+
|
|
|
+
|
|
|
+#----------------------------------------------
|
|
|
+echo "40.Station-publish.sh find projects and build"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+docker run -i --rm \
|
|
|
+--env LANG=C.UTF-8 \
|
|
|
+-v $NUGET_PATH:/root/.nuget \
|
|
|
+-v $basePath:/root/code \
|
|
|
+serset/dotnet:sdk-6.0 \
|
|
|
+bash -c "
|
|
|
+set -e
|
|
|
+
|
|
|
+echo '#1 get netVersion'
|
|
|
+netVersion=\$(grep '<TargetFramework>' \$(grep '<publish>' -rl --include *.csproj /root/code | head -n 1) | grep -oP '>(.*)<' | tr -d '<>')
|
|
|
+echo netVersion: \$netVersion
|
|
|
+
|
|
|
+
|
|
|
+basePath=/root/code
|
|
|
+publishPath=\$basePath/Publish/release/release/Station\(\$netVersion\)
|
|
|
+mkdir -p \$publishPath
|
|
|
+
|
|
|
+echo '#2 publish Station'
|
|
|
+cd \$basePath
|
|
|
+for file in \$(grep -a '<publish>' . -rl --include *.csproj)
|
|
|
+do
|
|
|
+ cd \$basePath
|
|
|
+
|
|
|
+ #get publishName
|
|
|
+ publishName=\`grep '<publish>' \$file -r | grep -oP '>(.*)<' | tr -d '<>'\`
|
|
|
+
|
|
|
+ echo publish \$publishName
|
|
|
+
|
|
|
+ #publish
|
|
|
+ cd \$(dirname \"\$file\")
|
|
|
+ dotnet build --configuration Release
|
|
|
+ dotnet publish --configuration Release --output \"\$publishPath/\$publishName\"
|
|
|
+
|
|
|
+ #copy xml
|
|
|
+ for filePath in bin/Release/\$netVersion/*.xml ; do \\cp -rf \$filePath \"\$publishPath/\$publishName\";done
|
|
|
+done
|
|
|
+
|
|
|
+
|
|
|
+echo '#3 copy ReleaseFile'
|
|
|
+\cp -rf \$basePath/Publish/ReleaseFile/Station/. \"\$publishPath\"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+echo 'publish succeed!'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|