|
@@ -37,6 +37,7 @@ public class PipelineContext implements AutoCloseable {
|
|
|
private String compileDir;
|
|
private String compileDir;
|
|
|
private String dockerfile;
|
|
private String dockerfile;
|
|
|
private CommitInfo commitInfo;
|
|
private CommitInfo commitInfo;
|
|
|
|
|
+ // 格式为 registry.cn-chengdu.aliyuncs.com/reghao
|
|
|
private String dockerRegistry;
|
|
private String dockerRegistry;
|
|
|
private String buildTargetPath;
|
|
private String buildTargetPath;
|
|
|
|
|
|
|
@@ -79,8 +80,7 @@ public class PipelineContext implements AutoCloseable {
|
|
|
public String getRepoTag() {
|
|
public String getRepoTag() {
|
|
|
String repoTag = String.format("%s:%s", appId, commitInfo.getCommitId());
|
|
String repoTag = String.format("%s:%s", appId, commitInfo.getCommitId());
|
|
|
if (dockerRegistry != null) {
|
|
if (dockerRegistry != null) {
|
|
|
- repoTag = String.format("%s:%s", dockerRegistry, repoTag);
|
|
|
|
|
- repoTag = simplifyPath(repoTag);
|
|
|
|
|
|
|
+ repoTag = String.format("%s/%s", dockerRegistry, repoTag);
|
|
|
}
|
|
}
|
|
|
return repoTag;
|
|
return repoTag;
|
|
|
}
|
|
}
|
|
@@ -92,6 +92,13 @@ public class PipelineContext implements AutoCloseable {
|
|
|
return path.replaceAll("(?<!:)/{2,}", "/");
|
|
return path.replaceAll("(?<!:)/{2,}", "/");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void setDockerRegistry(String dockerRegistry) {
|
|
|
|
|
+ this.dockerRegistry= simplifyPath(dockerRegistry);
|
|
|
|
|
+ if (this.dockerRegistry.endsWith("/")) {
|
|
|
|
|
+ this.dockerRegistry = this.dockerRegistry.substring(0, this.dockerRegistry.length() - 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 更新或创建阶段状态
|
|
* 更新或创建阶段状态
|
|
|
*/
|
|
*/
|