Commit faef4914 by 李二毛

Merge branch 'development' into 'staging'

Development

See merge request liermao/microservice-autodevopspipelines!66
parents 9553eeec 58092a6b
Pipeline #4230 passed with stages
in 19 seconds
......@@ -4,6 +4,7 @@ stages:
- release-major
# Updating
- analysing-git-changes
- synchronizing-config
build_job:
stage: build
......@@ -15,20 +16,8 @@ build_job:
staging-major_job:
stage: release-major
script:
# global variable
- export Environment='Staging'
# 001 Continuous integration image to registry.
- bash ./devops/PipeLines/Creation/001_CI.sh
# 002 Create config information to k8s's configmap.
- bash ./devops/PipeLines/Creation/002_CreateConfig.sh
# 003 Release major to k8s's cluster.
- bash ./devops/PipeLines/Creation/003_ReleaseMajor.sh
# 004 Create gateway route.
- bash ./devops/PipeLines/Creation/Gateways/Kong/004_CreateGatewayRoute.sh
- bash ./devops/PipeLines/Creation/Creation_Pipeline.sh
only:
- rel/major
tags:
......@@ -37,20 +26,8 @@ staging-major_job:
prod-major_job:
stage: release-major
script:
# global variable
- export Environment='Production'
# 001 Continuous integration image to registry.
- bash ./devops/PipeLines/Creation/001_CI.sh
# 002 Create config information to k8s's configmap.
- bash ./devops/PipeLines/Creation/002_CreateConfig.sh
# 003 Release major to k8s's cluster.
- bash ./devops/PipeLines/Creation/003_ReleaseMajor.sh
# 004 Create gateway route.
- bash ./devops/PipeLines/Creation/Gateways/Kong/004_CreateGatewayRoute.sh
- bash ./devops/PipeLines/Creation/Creation_Pipeline.sh
only:
- rel/major
tags:
......@@ -59,14 +36,18 @@ prod-major_job:
staging-analysing-git-changes_job:
stage: analysing-git-changes
script:
# global variable
- export Environment='Staging'
# 001 Analysing git changes.
- bash +x ./devops/PipeLines/Updating/001_AnalysingGitChanges.sh
- bash ./devops/PipeLines/Updating/001_AnalysingGitChanges.sh
only:
- staging
tags:
- staging
# 002 Synchronize config information to k8s's configmap.
- bash +x ./devops/PipeLines/Updating/002_SyncConfig.sh
staging-synchronizing-config_job:
stage: synchronizing-config
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/002_SyncConfig.sh
only:
- staging
tags:
......
#!/bin/bash
set -e
IFS=$'\n\n'
# 001 Continuous integration image to registry.
bash ./devops/PipeLines/Creation/001_CI.sh
# 002 Create config information to k8s's configmap.
bash ./devops/PipeLines/Creation/002_CreateConfig.sh
# 003 Release major to k8s's cluster.
bash ./devops/PipeLines/Creation/003_ReleaseMajor.sh
# 004 Create gateway route.
bash ./devops/PipeLines/Creation/Gateways/Kong/004_CreateGatewayRoute.sh
\ No newline at end of file
......@@ -17,9 +17,7 @@ function AddConfig()
declare name=${1}
declare publishable=${2}
if [ "${publishable}" == "1" ]; then
echo "<${name}Publishable>${publishable}</${name}Publishable>" >> /tmp/cicd.props
fi
echo "<${name}Publishable>${publishable}</${name}Publishable>" >> /tmp/cicd.props
}
function AddTailConfig()
......@@ -63,17 +61,20 @@ else
AddHeadConfig "1","0"
for servicePrefix in `ls ./src/Services|xargs -d '/'`
do
# Notes: manual control, mandatory release, will not analyzing changes
# Notes: Hard release[manual control], will not analyz changes.
isPublishable=$(eval echo ${servicePrefix}Publishable)
if [ "${isPublishable}" == "1" ];
then
AddConfig "${servicePrefix}" "${isPublishable}"
echo "Tips[Hard Release]: ${servicePrefix} will be released."
else
# Analyzing git changes
# Soft Release, begin Analyzing git changes
IsPublishable "src/${servicePrefix}" isPublishable publishableCount
AddConfig "${servicePrefix}" "${isPublishable}"
echo "Tips[Soft Release]: ${servicePrefix} will be released."
if [ "${isPublishable}" == "1" ];
then
AddConfig "${servicePrefix}" "${isPublishable}"
echo "Tips[Soft Release]: ${servicePrefix} will be released."
fi
fi
done
AddTailConfig
......
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