Commit ce3abf3b by 李二毛

Merge branch 'development' into 'rel/major'

Development

See merge request liermao/microservice-autodevopspipelines!20
parents 8b874af6 11f1175f
Pipeline #4104 failed with stages
in 32 seconds
......@@ -26,30 +26,12 @@ declare publishOutputDir=./publish
rm -fr ${publishOutputDir}
mkdir -p ${publishOutputDir}
function CI()
{
declare publishable=$1
declare imagename=$2
echo ""
declare imagefullname=${RegistryHost}/${registryUserName}/${imagename}:${version}
declare publishFile=$3
echo "begin delivery for ${imagename}..."
mkdir -p ${publishOutputDir}/${imagename}
dotnet publish ${publishFile} -o ../../publish/${imagename} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}/${imagename}
docker push ${imagefullname}
rm -fr ${publishOutputDir}/${imagename}
echo "delivery for ${imagename}:${version} has been successful."
}
GetServices services
for service in ${services}
do
IsPublishableOf ${service} isPublishable
GetServiceName "${service}" serviceName
CI "${service}" "./src/${service}/${serviceName}.csproj"
CI "${serviceName}" "./src/${service}/${serviceName}/${serviceName}.csproj" ${publishOutputDir}
done
echo ""
......
......@@ -2,6 +2,13 @@
set -e
function ToLower()
{
declare input=$1
declare output=($(echo "${input}" | tr 'A-Z' 'a-z'))
$2=output
}
function GetServices()
{
declare svcs=($(ls ./src/Services|xargs -d '/' echo))
......@@ -74,4 +81,21 @@ function IsPublishableOf()
declare prefix=$0
declare isP=($(grep -oP "(?<=${prefix}Publishable>)[^<]+" "/tmp/cicd.props"))
eval $1=isP
}
function CI()
{
declare publishFile=$2
declare publishOutputDir=s2
ToLower $1 imagename
declare imagefullname=${RegistryHost}/${registryUserName}/${imagename}:${version}
echo ""
echo "begin delivery for ${imagename}..."
mkdir -p ${publishOutputDir}/${imagename}
dotnet publish ${publishFile} -o ../../publish/${imagename} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}/${imagename}
docker push ${imagefullname}
rm -fr ${publishOutputDir}/${imagename}
echo "delivery for ${imagename}:${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