Commit 67ff337a by 据说甜蜜呢

修改CI方法

parent a520ecda
Pipeline #4119 passed with stage
in 18 seconds
...@@ -18,9 +18,6 @@ dotnet build ${solutionName} ...@@ -18,9 +18,6 @@ dotnet build ${solutionName}
echo "" echo ""
echo "Please check the version of each microservice carefully !!!" echo "Please check the version of each microservice carefully !!!"
GetVersion version
GetImageUserName registryUserName
declare publishOutputDir=./publish declare publishOutputDir=./publish
rm -fr ${publishOutputDir} rm -fr ${publishOutputDir}
......
...@@ -93,23 +93,22 @@ function IsPublishableOf() ...@@ -93,23 +93,22 @@ function IsPublishableOf()
function CI() function CI()
{ {
declare serviceName=$1
declare publishFile=$2 declare publishFile=$2
declare publishOutputDir=s2 declare publishOutputDir=s2
GetVersion version
GetImageUserName registryUserName GetImageUserName registryUserName
# repository name must be lowercase # repository name must be lowercase
ToLower ${RegistryHost} RegistryHost ToLower "${RegistryHost}/${registryUserName}/${serviceName}:${version}" imagefullname
ToLower ${registryUserName} registryUserName
ToLower ${imagename} imagename
declare imagefullname="${RegistryHost}/${registryUserName}/${imagename}:${version}"
echo "" echo ""
echo "begin delivery for ${imagename}..." echo "begin delivery for ${serviceName}:${version}..."
mkdir -p ${publishOutputDir}/${imagename} mkdir -p ${publishOutputDir}/${serviceName}
dotnet publish ${publishFile} -o ../../publish/${imagename} -c release --no-restore dotnet publish ${publishFile} -o ../../publish/${serviceName} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}/${imagename} docker build -t ${imagefullname} ${publishOutputDir}/${serviceName}
docker push ${imagefullname} docker push ${imagefullname}
rm -fr ${publishOutputDir}/${imagename} rm -fr ${publishOutputDir}/${serviceName}
echo "delivery for ${imagename}:${version} has been successful." echo "delivery for ${serviceName}:${version} has been successful."
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment