Skip to content

Commit

Permalink
Better temporary image tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
manojlds committed May 22, 2016
1 parent 09016b2 commit ebd7653
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public void run() throws Exception {
}

protected String getTemporaryImageTag(Context taskContext) {
return String.format("docker-task:%s", taskContext.getPipelineLabel());
return String.format("docker-task-%s-%s-%s:%s",
taskContext.getPipelineName().toLowerCase(), taskContext.getStageName().toLowerCase(),
taskContext.getJobName().toLowerCase(), taskContext.getPipelineLabel().toLowerCase());
}

protected String getDockerBuildTag(Context taskContext, Config taskConfig) {
Expand Down
12 changes: 12 additions & 0 deletions docker-task/src/main/java/com/stacktoheap/go/docker/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ public String getPipelineLabel() {
return environmentVariables.get("GO_PIPELINE_LABEL").toString();
}

public String getPipelineName() {
return environmentVariables.get("GO_PIPELINE_NAME").toString();
}

public String getStageName() {
return environmentVariables.get("GO_STAGE_NAME").toString();
}

public String getJobName() {
return environmentVariables.get("GO_JOB_NAME").toString();
}

public String getWorkingDir() {
return workingDir;
}
Expand Down

0 comments on commit ebd7653

Please sign in to comment.