Skip to content

Commit

Permalink
Cherry-pick to 7.x: feat(ci): support building docker images for PRs (#…
Browse files Browse the repository at this point in the history
…20323) (#20468)

* feat(ci): support building docker images for PRs (#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

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
  • Loading branch information
mdelapenya and v1v authored Aug 11, 2020
1 parent 036609e commit 1082321
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 1082321

Please sign in to comment.