Skip to content

Commit

Permalink
Cherry-pick to 7.9: feat(ci): support building docker images for PRs (e…
Browse files Browse the repository at this point in the history
…lastic#20323) (elastic#20467)

* feat(ci): support building docker images for PRs (elastic#20323)

* feat(ci): support building docker images for PRs

* chore: use PR_ID as tag

* chore(ci): use build step for checking if is PR
  • Loading branch information
mdelapenya committed Aug 11, 2020
1 parent c5fa0f1 commit a087c67
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 (isPR()) {
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 a087c67

Please sign in to comment.