Commit 03138539 by 据说甜蜜呢

添加方法

parent 2c45fc5f
......@@ -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