Skip to content

Commit

Permalink
feat(ci): support building docker images for PRs (elastic#20323)
Browse files Browse the repository at this point in the history
* feat(ci): support building docker images for PRs

* chore: use PR_ID as tag
  • Loading branch information
mdelapenya authored and melchiormoulin committed Oct 14, 2020
1 parent 6ecf748 commit 66c5a08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,14 @@ def tagAndPush(name){
if("${env.SNAPSHOT}" == "true"){
libbetaVer += "-SNAPSHOT"
}

def tagName = "${libbetaVer}"
if (env.CHANGE_ID?.trim()) {
tagName = "pr-${env.CHANGE_ID}"
}

def oldName = "${DOCKER_REGISTRY}/beats/${name}:${libbetaVer}"
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}:${libbetaVer}"
def newName = "${DOCKER_REGISTRY}/observability-ci/${name}:${tagName}"
def commitName = "${DOCKER_REGISTRY}/observability-ci/${name}:${env.GIT_BASE_COMMIT}"
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
retry(3){
Expand Down

0 comments on commit 66c5a08

Please sign in to comment.