Commit c48473e1 by 李二毛

Merge branch 'development' into 'rel/major'

Development

See merge request liermao/microservice-autodevopspipelines!34
parents 83143c0d 40f164c3
Pipeline #4135 failed with stages
in 16 seconds
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
set -e set -e
# Import external functions # Import external functions
chmod +x ./devops/PipeLines/Functions.sh chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.sh source ./devops/PipeLines/Functions.deploy.sh
GetAppName appName GetAppName appName
echo "" echo ""
...@@ -18,8 +18,8 @@ dotnet build ${solutionName} ...@@ -18,8 +18,8 @@ dotnet build ${solutionName}
echo "" echo ""
echo "Please check the version of each microservice carefully !!!" echo "Please check the version of each microservice carefully !!!"
GetServices services #GetServices services
for servicePrefix in ${services} for servicePrefix in `ls ./src/Services|xargs -d '/'`
do do
GetServiceName ${servicePrefix} serviceName GetServiceName ${servicePrefix} serviceName
GetServiceCsProjFile ${servicePrefix} ${serviceName} serviceCsProjFile GetServiceCsProjFile ${servicePrefix} ${serviceName} serviceCsProjFile
......
...@@ -11,8 +11,7 @@ function ToLower() ...@@ -11,8 +11,7 @@ function ToLower()
function GetServices() function GetServices()
{ {
declare svcs=($(ls ./src/Services|xargs -d '/' echo)) # eval $1=`ls ./src/Services|xargs -d '/'`
eval $1="${svcs}"
} }
function GetServiceCsProjFile() function GetServiceCsProjFile()
...@@ -90,26 +89,3 @@ function IsPublishableOf() ...@@ -90,26 +89,3 @@ function IsPublishableOf()
declare isP=($(grep -oP "(?<=${prefix}Publishable>)[^<]+" "/tmp/cicd.props")) declare isP=($(grep -oP "(?<=${prefix}Publishable>)[^<]+" "/tmp/cicd.props"))
eval $1=isP eval $1=isP
} }
\ No newline at end of file
function CI()
{
declare serviceName=$1
declare publishFile=$2
declare publishOutputDir="/tmp/${serviceName}"
GetVersion version
GetImageUserName registryUserName
# repository name must be lowercase
ToLower "${RegistryHost}/${registryUserName}/${serviceName}:${version}" imagefullname
echo ""
echo "Begin delivering for ${serviceName}..."
echo "Tips: Image full name: ${imagefullname}"
mkdir -p ${publishOutputDir}
dotnet publish ${publishFile} -o ${publishOutputDir} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}
docker push ${imagefullname}
rm -fr ${publishOutputDir}
echo "Delivery for ${serviceName} has been successful."
}
\ No newline at end of file
#!/bin/bash
set -e
# Import external functions
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
function CI()
{
declare serviceName=$1
declare publishFile=$2
declare publishOutputDir="/tmp/${serviceName}"
GetVersion version
GetImageUserName registryUserName
# repository name must be lowercase
ToLower "${RegistryHost}/${registryUserName}/${serviceName}:${version}" imagefullname
echo ""
echo "Begin delivering for ${serviceName}..."
echo "Tips: Image full name: ${imagefullname}"
mkdir -p ${publishOutputDir}
dotnet publish ${publishFile} -o ${publishOutputDir} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}
docker push ${imagefullname}
rm -fr ${publishOutputDir}
echo "Delivery for ${serviceName} 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