Skip to content

Commit

Permalink
Merge pull request #52 from opendevstack/fix/tag-image-in-cd-project
Browse files Browse the repository at this point in the history
Update Jenkinsfile
  • Loading branch information
michaelsauter authored Dec 17, 2020
2 parents 9555a71 + a925ee7 commit b109f5c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ library("ods-jenkins-shared-library@${odsGitRef}")

odsComponentPipeline(
imageStreamTag: "${odsNamespace}/jenkins-agent-maven:${odsImageTag}",
branchToEnvironmentMapping: [
'*' : 'dev',
"${odsGitRef}" : 'test'
],
branchToEnvironmentMapping: [:],
debug: true,
resourceRequestMemory: '3Gi',
resourceLimitMemory: '3Gi'
) { context ->
stageBuild(context)
odsComponentStageScanWithSonar(context, [branch: '*'])
odsComponentStageBuildOpenShiftImage(context)
odsComponentStageBuildOpenShiftImage(context, [branch: '*'])
stageCreatedImageTagLatest(context)
}

Expand Down Expand Up @@ -67,7 +64,7 @@ def stageCreatedImageTagLatest(def context) {
stage('Tag created image') {
def targetImageTag = context.gitBranch.replace('/','_').replace('-','_')
sh(
script: "oc -n ${context.targetProject} tag ${context.componentId}:${context.shortGitCommit} ${context.componentId}:${targetImageTag}",
script: "oc -n ${context.cdProject} tag ${context.componentId}:${context.shortGitCommit} ${context.componentId}:${targetImageTag}",
label: "Set tag '${targetImageTag}' on is/${context.componentId}"
)
}
Expand Down

0 comments on commit b109f5c

Please sign in to comment.