product = 'gbw'
profile = 'test'
def acrAdress(product,profile){
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'
]
DPACK = [
'prod',
'gray',
'release'
]
if (!DPACK.contains(profile) || !hangzhouCluster.contains(product)){
registry = registryEnv.get('extranet')
namespace = 'snapshot'
println registry + '/' + namespace
return registry + '/' + namespace
}
if (standardProduct.contains(product)){
registry = registryEnv.get('intranet')
namespace = 'release'
println registry + '/' + namespace
return registry + '/' + namespace
}
if (nonstandardProduct.contains(product)){
if (DPACK){
registry = registryEnv.get('intranet')
namespace = 'snapshot'
println registry + '/' + namespace
return registry + '/' + namespace
}
}
}
def switchAck(product,profile){
hangzhouCluster = [
'gbw',
'gbd',
'ly-xuancheng',
'ly-yaan'
]
chengduCluster = ['financial']
DPACK = [
'prod',
'gray',
'release'
]
if (hangzhouCluster.contains(product) && DPACKcontains(profile) ){
ackRegion = 'hangzhou'
println ackRegion
return ackRegion
}
if (chengduCluster.contains(product) && DPACKcontains(profile) ){
ackRegion = 'chengdu'
println ackRegion
return ackRegion
}
}
acrAdress('financial','prod')