product = 'ly-xuancheng'
profile = 'prod'
// aliyun acr address
registryEnv = [
'intranet':'cngongbao-registry-vpc.cn-hangzhou.cr.aliyuncs.com',
'extranet':'cngongbao-registry.cn-hangzhou.cr.aliyuncs.com'
]
// 杭州生产集群部署包含的产品线
hangzhouCluster = [
'gbw',
'gbd',
'ly-xuancheng',
'ly-yaan'
]
// 成都生产集群部署包含的产品线
chengduCluster = ['financial']
// 标准化部署
standardProduct = [
'gbw',
'gbd'
]
// 非标准化部署
nonstandardProduct = [
'ly-xuancheng',
'ly-yaan',
'financial'
]
// 部署ack到环境
DPACK = [
'prod',
'gray',
'release'
]
// 非部署在ack 杭州集群内走公网
if (!DPACK.contains(profile) || !hangzhouCluster.contains(product)){
registry = registryEnv.get('extranet')
namespace = 'snapshot'
println registry + '/' + namespace
println 1
return registry + '/' + namespace
}
// 标准化部署
// if (standardProduct.contains(product) && DPACK.contains(profile)){
if (standardProduct.contains(product)){
registry = registryEnv.get('intranet')
namespace = 'release'
println 2
println registry + '/' + namespace
return registry + '/' + namespace
}
// 非标准化部署
if (nonstandardProduct.contains(product)){
if (DPACK){
registry = registryEnv.get('intranet')
namespace = 'snapshot'
println 3
println registry + '/' + namespace
return registry + '/' + namespace
}
}
// if (nonstandardProduct.contains(product)){
// if (!DPACK){
// registry = registryEnv.get('extranet')
// namespace = 'snapshot'
// println 3
// println registry + '/' + namespace
// return registry + '/' + namespace
// } else {
// registry = registryEnv.get('intranet')
// namespace = 'snapshot'
// println 4
// println registry + '/' + namespace
// return registry + '/' + namespace
// }
// }