Commit 0775f11e by 李二毛

Merge branch 'development' into 'staging'

Development

See merge request liermao/microservice-autodevopspipelines!110
parents 1a295aab c9a66017
Pipeline #4378 passed with stages
in 59 seconds
#!/bin/bash #!/bin/bash
set -e set -e
IFS=$'\n\n'
# Import external functions # Import external functions
chmod +x ./devops/PipeLines/Functions.deploy.sh chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh source ./devops/PipeLines/Functions.deploy.sh
# global variable GetNameSpace namespace
RollEnvironmentOf Environment GetReplicas replicas
GetAppName appName if [ "${AllPublishable}" == "1" ];
echo "[${Environment}]Auto scaling for ${appName} starting..."
GetCiCdSettings allPublishable noPublishable
if [ "${noPublishable}" == "1" ] ;
then then
echo "" echo "Tips: All micro-services will be scaled, replicas: [${replicas}]."
echo "Tips: No services need to be cded." for servicePrefix in `ls ./src/Services|xargs -d '/'`
do
GetServiceName ${servicePrefix} serviceName
AutoScaling ${namespace} ${serviceName} ${replicas}
done
else else
GetNameSpace namespace
GetReplicas replicas
for servicePrefix in `ls ./src/Services|xargs -d '/'` for servicePrefix in `ls ./src/Services|xargs -d '/'`
do do
IsPublishableOf ${servicePrefix} isPublishable DynamicVariableValueOf "${servicePrefix}" "Publishable" isPublishable
GetServiceName ${servicePrefix} serviceName
if [ "${isPublishable}" == "1" ]; if [ "${isPublishable}" == "1" ];
then then
echo "" echo "Tips: ${servicePrefix} will be scaled, replicas: [${replicas}]."
echo "Tips: ${serviceName} begin scaling, replicas: [${replicas}]!!!" GetServiceName ${servicePrefix} serviceName
AutoScaling ${namespace} ${serviceName} ${replicas} AutoScaling ${namespace} ${serviceName} ${replicas}
else fi
echo ""
echo "Tips: ${serviceName} will not be scaled!!!"
fi
done done
fi fi
\ No newline at end of file
echo ""
echo "[${Environment}]Auto scaling for ${appName} has been successful."
\ No newline at end of file
#!/bin/bash #!/bin/bash
set -e set -e
IFS=$'\n\n'
# Import external functions # Import external functions
chmod +x ./devops/PipeLines/Functions.deploy.sh chmod +x ./devops/PipeLines/Functions.deploy.sh
source ./devops/PipeLines/Functions.deploy.sh source ./devops/PipeLines/Functions.deploy.sh
# global variable # global variable
RollEnvironmentOf Environment ReleaseEnvironmentOf Environment
GetAppName appName GetRollBackVersion version
GetNameSpace namespace
GetRegistryHost registryHost
GetImageUserName registryUserName
echo "Continuous deployment[${Environment}] for ${appName} starting..." if [ "${AllPublishable}" == "1" ];
GetCiCdSettings allPublishable noPublishable
if [ "${noPublishable}" == "1" ] ;
then then
echo "" echo "Tips: All micro-services will be roll-backed, version: ${version}."
echo "Tips: No services need to be cded." for servicePrefix in `ls ./src/Services|xargs -d '/'`
do
GetServiceName ${servicePrefix} serviceName
CD ${registryHost} ${registryUserName} ${serviceName} ${version} ${namespace}
done
else else
GetRollBackVersion version
GetNameSpace namespace
GetRegistryHost registryHost
GetImageUserName registryUserName
for servicePrefix in `ls ./src/Services|xargs -d '/'` for servicePrefix in `ls ./src/Services|xargs -d '/'`
do do
IsPublishableOf ${servicePrefix} isPublishable DynamicVariableValueOf "${servicePrefix}" "Publishable" isPublishable
GetServiceName ${servicePrefix} serviceName
if [ "${isPublishable}" == "1" ]; if [ "${isPublishable}" == "1" ];
then then
echo "" echo "Tips: ${servicePrefix} will be roll-backed, version: ${version}."
echo "Tips: ${serviceName} begin deployment to K8S!!!" GetServiceName ${servicePrefix} serviceName
CD ${registryHost} ${registryUserName} ${serviceName} ${version} ${namespace} CD ${registryHost} ${registryUserName} ${serviceName} ${version} ${namespace}
else fi
echo ""
echo "Tips: ${serviceName} will not be deploymented to K8S!!!"
fi
done done
fi fi
\ No newline at end of file
echo ""
echo "Continuous deployment[${Environment}] for ${appName} has been successful."
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Replicas>1</Replicas> <Replicas>2</Replicas>
<RollBackStep>1</RollBackStep> <RollBackStep>1</RollBackStep>
<ImageUserName>devopspipelines</ImageUserName> <ImageUserName>devopspipelines</ImageUserName>
</PropertyGroup> </PropertyGroup>
......
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