Commit b654fdf5 by 据说甜蜜呢

添加方法

parent afe3f263
......@@ -27,4 +27,25 @@ function CI()
docker push ${imagefullname}
rm -fr ${publishOutputDir}
echo "Delivery for ${serviceName} has been successful."
}
function CD()
{
declare registryHost=$1
declare registryUserName=$2
declare serviceName=$3
declare version=$4
Replace ${serviceName} '.' '-' appName
# repository name must be lowercase
ToLower "${registryHost}/${registryUserName}/${serviceName}:${version}" imagefullname
ToLower ${appName} appNameOfK8s
kubectl -n ${namespace} set image deployments/${appNameOfK8s} "${appNameOfK8s}=${imagefullname}";
# [compatible]Staging environment does not need to change version number.
if [ "${Environment}" == "Staging" ]; then
kubectl -n ${namespace} scale deploy ${appNameOfK8s} --replicas=0;
kubectl -n ${namespace} scale deploy ${appNameOfK8s} --replicas=1;
fi
echo "Deployment[${Environment}] for ${appName}:${version} 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