这是当前的代码,我正在尝试围绕替代方案进行思考:
目前我们有:
URL_PREFIX = "http://ourrepo:8081/artifactory"
pattern = re.compile(r'^.*-(ngwebui|nodeservice).*$')
if pattern.match(artifact):
return URL_PREFIX + "/npm-local/region/%s/-/region/%s-%s" % (artifact, artifact, version)
else:
return URL_PREFIX + "/libs-releases-local/org/region/%s/%s/%s-%s" % (artifact, version, artifact, version)
我想做的是将另一种称为“dockerservice”的类型合并到其中,其URL_PREFIX值通过
URL_PREFIX + "/docker-dev-local/%s-%s" % (artifact, artifact, version)
用 ?if ngwebui|nodeservice URL_PREFIX, dockerservice URL_PREFIX, else URL_PREFIX:
繁星点点滴滴
相关分类