Project 'liermao/microservice-autodevopspipelines' was moved to 'lichunsheng/microservice-autodevopspipelines'. Please update any links and bookmarks that may still have the old path.
Commit 25e2a182 by 李二毛

Merge branch 'development' into 'rel/major'

Development

See merge request liermao/microservice-autodevopspipelines!53
parents a6529178 1d5f5113
Pipeline #4181 failed with stages
in 1 second
......@@ -5,9 +5,7 @@ stages:
build_job:
stage: build
script:
- echo "begin build..."
- dotnet build MicroService.AutoDevOpsPipeLines.sln
- echo "build successful."
- bash ./devops/Build.sh
tags:
- build
......@@ -19,7 +17,7 @@ staging-major_job:
- export K8sApiServer='https://172.24.83.222:6443'
# 001 Continuous integration image to registry.
# - bash ./devops/PipeLines/Creation/001_CI.sh
- bash ./devops/PipeLines/Creation/001_CI.sh
# 002 Create config information to k8s's configmap.
- bash ./devops/PipeLines/Creation/002_CreateConfig.sh
......@@ -30,7 +28,6 @@ staging-major_job:
# 004 Create gateway route.
- export KongApiServer='http://127.0.0.1:81'
- export KongRouteDomain='staging-api.geekbuy.cn'
- bash ./devops/PipeLines/Creation/Gateways/Kong/004_CreateGatewayRoute.sh
only:
- rel/major
......
#!/bin/bash
set -e
# Import external functions
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
GetSolutionName SolutionName
echo "begin build..."
dotnet build ${SolutionName}
echo "build successful."
\ No newline at end of file
......@@ -68,23 +68,19 @@ function createRoute()
set -e
}
declare serviceFdn=""
declare serviceUrl=""
declare serviceRouteUrl=""
for servicePrefix in `ls ./src/Services|xargs -d '/'`
do
GetServiceName ${servicePrefix} serviceName
# replace . to -, compatible with k8s.
serviceName=${serviceName/\./\-}
Replace ${serviceName} '.' '-' serviceName
ToLower "${serviceName}-${releaseVersion}" serviceNameWithVersion
serviceFdn="${serviceName}.${fdnOfK8s}"
serviceUrl="http://${serviceFdn}/api/${servicePrefix}"
ToLower "http://${serviceFdn}/api/${prefix}" serviceUrl
echo "Begin creating service[${serviceNameWithVersion}]"
createService ${kongServiceBaseUrl} ${maxConnectTime} ${maxTime} ${retryCount} ${serviceNameWithVersion} ${serviceUrl}
echo "Begin creating route of service[${serviceNameWithVersion}]"
serviceRouteUrl="/api/${releaseVersion}/${servicePrefix}"
ToLower "/api/${releaseVersion}/${servicePrefix}" serviceRouteUrl
createRoute ${kongRouteBaseUrl} ${maxConnectTime} ${maxTime} ${retryCount} ${serviceNameWithVersion} ${serviceRouteUrl} true
done
......
......@@ -9,6 +9,15 @@ function ToLower()
eval $2=${output}
}
function Replace()
{
declare input=$1
declare sourceExpr=$2
declare targetExpr=$3
declare output=${input//${sourceExpr}/${targetExpr}}
eval $4=${output}
}
# function GetServices()
# {
#
......
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