Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge stage-name-updates into master (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic Patterson authored Mar 1, 2018
1 parent edc1c92 commit 0cd9c0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Jenkins Workflows

## v0.4.1

### Changed

* docker: Stage names changed to be more simple.

## v0.4.0

### Added
Expand Down
9 changes: 3 additions & 6 deletions docker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,12 @@ public push(Map yml, Map args) {
* Set the name of the stage dynamically.
*/
public getStageName(Map yml, Map args, String stepName) {
String buildVersion = concurGit.getVersion(yml)
String imageName = args?.imageName ?: yml.tools?.docker?.imageName ?: "${env.GIT_OWNER}/${env.GIT_REPO}"
switch(stepName) {
case 'build':
def dockerfile = args?.dockerfile ?: yml.tools?.docker?.dockerfile
return dockerfile ? "docker: build: $dockerfile": 'docker: build'
return dockerfile ? "docker: build: $imageName": 'docker: build'
case 'push':
String imageTag = args?.imageTag ?: yml.tools?.docker?.imageTag ?: buildVersion
String imageName = args?.imageName ?: yml.tools?.docker?.imageName ?: "${env.GIT_OWNER}/${env.GIT_REPO}"
return "docker: push: $imageName:$imageTag"
return "docker: push: $imageName"
}
}

Expand Down

0 comments on commit 0cd9c0e

Please sign in to comment.