Commit d8fb9433 by 李二毛

Merge branch 'development' into 'release/staging'

发布预生产环境

See merge request liermao/microservice-autodevopspipelines!92
parents 3707004c b7ae2069
Pipeline #4310 canceled with stages
in 16 seconds
......@@ -18,92 +18,90 @@ build_job:
tags:
- build
staging-major_job:
release-major_job:
stage: release-major
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Creation/Creation_Pipeline.sh
only:
- rel/major
- release/staging
- release/production
tags:
- staging
prod-major_job:
stage: release-major
script:
- export Environment='Production'
- bash ./devops/PipeLines/Creation/Creation_Pipeline.sh
only:
- rel/major
tags:
- production
analysing-git-changes_job:
stage: analysing-git-changes
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/001_AnalysingGitChanges.sh
only:
- staging
- production
tags:
- staging
- production
synchronizing-config_job:
stage: synchronizing-config
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/002_SyncConfig.sh
only:
- staging
- production
tags:
- staging
- production
ci_job:
stage: ci
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/003_CI.sh
only:
- staging
- production
tags:
- staging
- production
cd_job:
stage: cd
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/004_CD.sh
only:
- staging
- production
tags:
- staging
- production
is-k8s-ready_job:
stage: is-k8s-ready
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/005_IsK8sReady.sh
only:
- staging
- production
tags:
- staging
- production
testing_job:
stage: testing
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/006_Testing.sh
only:
- staging
- production
tags:
- staging
- production
clean-k8s_job:
stage: clean-k8s
script:
- export Environment='Staging'
- bash ./devops/PipeLines/Updating/007_CleanK8s.sh
only:
- staging
- production
tags:
- staging
\ No newline at end of file
- staging
- production
\ No newline at end of file
......@@ -7,8 +7,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.gitlab-ci.yml = .gitlab-ci.yml
devops\app.props = devops\app.props
devops\branch.env.props = devops\branch.env.props
devops\deploy.production.props = devops\deploy.production.props
devops\deploy.props = devops\deploy.props
devops\Gateways\kong.props = devops\Gateways\kong.props
devops\deploy.staging.props = devops\deploy.staging.props
devops\token.props = devops\token.props
devops\version.props = devops\version.props
EndProjectSection
......@@ -51,7 +53,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingB
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{26EA0840-FACE-4F72-B7D0-64CA9443BD9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcExtensions", "src\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj", "{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcExtensions", "src\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj", "{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
......@@ -6,6 +6,9 @@ set -e
chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh
# global variable
ReleaseEnvironmentOf Environment
GetAppName appName
echo ""
echo "Continuous integration for ${appName} starting..."
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.config.sh
source ./devops/PipeLines/Functions.config.sh
# global variable
ReleaseEnvironmentOf Environment
GetAppName appName
echo ""
echo "Begin creating ${appName}'s settings to the configmap of k8s..."
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
# global variable
ReleaseEnvironmentOf Environment
GetAppName appName
echo "Starting release for ${appName}, it will dynamicly create k8s environment..."
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
# global variable
RollEnvironmentOf Environment
GetAppName appName
echo "Start dynamically building the gateway route for ${appName}..."
......
#
οű
## k8s
helm delete --purge microservice.autodevopspipeline.v0
kubectl delete namespace microservice-autodevopspipeline-v0
helm delete --purge microservice.autodevopspipeline.v1
kubectl delete namespace microservice-autodevopspipeline-v1
## gateway
delete FROM routes where created_at>'2019-01-10';
......
......@@ -136,4 +136,21 @@ function IsPublishableOf()
declare prefix=$1
declare isP=($(grep -oP "(?<=${prefix}Publishable>)[^<]+" "/tmp/cicd.props"))
eval $2="${isP}"
}
# get updating's environment of branch
function RollEnvironmentOf()
{
FirstCharUpperCase ${CI_COMMIT_REF_NAME} branch
declare env=($(grep -oP "(?<=${branch}>)[^<]+" "./devops/branch.env.props"))
eval $1="${env}"
}
# get creation's environment of branch
function ReleaseEnvironmentOf()
{
declare branch=${CI_COMMIT_REF_NAME}
declare name=($(echo "${branch}"|xargs -d '/'|awk '{print $2}'))
FirstCharUpperCase ${name} env
eval $1="${env}"
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ set -e
# Import external functions
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
function CI()
{
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.config.sh
source ./devops/PipeLines/Functions.config.sh
# global variable
RollEnvironmentOf Environment
GetAppName appName
echo ""
echo "Begin synchronizing ${appName}'s settings to the configmap of k8s..."
......
......@@ -6,6 +6,9 @@ set -e
chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh
# global variable
RollEnvironmentOf Environment
GetAppName appName
echo "Continuous integration[${Environment}] for ${appName} starting..."
......
......@@ -5,6 +5,9 @@ set -e
chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh
# global variable
RollEnvironmentOf Environment
GetAppName appName
echo "Continuous deployment[${Environment}] for ${appName} starting..."
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
# global variable
RollEnvironmentOf Environment
#1: ready, 0: not ready.
declare ready=0
......
......@@ -2,6 +2,13 @@
set -e
# Import external functions
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
# global variable
RollEnvironmentOf Environment
echo "[${Environment}]Begin testing..."
declare dir='./test/ServicesTests'
for prefix in `ls ${dir}|xargs -d '/'`
......
......@@ -6,6 +6,9 @@ IFS=$'\n\n'
chmod +x ./devops/PipeLines/Functions.core.sh
source ./devops/PipeLines/Functions.core.sh
# global variable
RollEnvironmentOf Environment
GetNameSpace namespace
echo "[${Environment}]Begin cleaning..."
......
<Project>
<PropertyGroup>
<!--key: branch name, value: environment-->
<staging>Staging</staging>
<master>Production</master>
</PropertyGroup>
</Project>
#!/bin/bash
# Import external functions
chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh
GetNameSpace namespace
echo ${namespace}
function CD()
{
declare namespace=$1
echo ${namespace}
}
CD ${namespace}
\ 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