Skip to content

Commit

Permalink
Merge pull request #62 from stakater/dockerimage-parameterize
Browse files Browse the repository at this point in the history
parameterize docker image name and version
  • Loading branch information
kahootali authored May 11, 2020
2 parents 38759a4 + 8ec1325 commit 2bcad7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vars/pushDockerImage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def call(body) {

container(name: 'tools') {
withCurrentRepo(useToken: true, tokenSecretName: 'GithubToken') { def repoUrl, def repoName, def repoOwner, def repoBranch ->
def imageName = repoName.split("dockerfile-").last().toLowerCase()
def imageName = config.imageName ? config.imageName : repoName.split("dockerfile-").last().toLowerCase()
if (repoOwner.startsWith('stakater-')){
repoOwner = 'stakater'
}
echo "Repo Owner: ${repoOwner}"
def dockerImage = "${dockerRepositoryURL}/${repoOwner.toLowerCase()}/${imageName}"
// If image Prefix is passed, use it, else pass empty string to create versions
def imagePrefix = config.imagePrefix ? config.imagePrefix + '-' : ''
def dockerImageVersion = stakaterCommands.createImageVersionForCiAndCd(repoUrl, imagePrefix, "${env.BRANCH_NAME}", "${env.BUILD_NUMBER}")
def dockerImageVersion = config.imageVersion ? config.imageVersion : stakaterCommands.createImageVersionForCiAndCd(repoUrl, imagePrefix, "${env.BRANCH_NAME}", "${env.BUILD_NUMBER}")

try {
stage('Canary Release') {
Expand Down

0 comments on commit 2bcad7d

Please sign in to comment.