Skip to content

Commit

Permalink
Merge pull request hyperledger-iroha#1606 from hyperledger/fix/ci-doc…
Browse files Browse the repository at this point in the history
…ker-push

Docker images push on existing develop branch PR
  • Loading branch information
bakhtin authored Jul 26, 2018
2 parents d6384ef + 225bffb commit 3e27259
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .jenkinsci/debug-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ def doDebugBuild(coverageEnabled=false) {
if (env.NODE_NAME.contains('arm7')) {
parallelism = 1
}

sh "docker network create ${env.IROHA_NETWORK}"
def iC = dPullOrBuild.dockerPullOrUpdate("${platform}-develop-build",
"${env.GIT_RAW_BASE_URL}/${env.GIT_COMMIT}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/${previousCommit}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/develop/docker/develop/Dockerfile",
['PARALLELISM': parallelism])

if (GIT_LOCAL_BRANCH == 'develop' && manifest.manifestSupportEnabled()) {
// push Docker image in case the current branch is develop,
// or it is a commit into PR which base branch is develop (usually develop -> master)
if ((GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH == 'develop') && manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop-build",
["${DOCKER_REGISTRY_BASENAME}:x86_64-develop-build",
"${DOCKER_REGISTRY_BASENAME}:armv7l-develop-build",
Expand Down
7 changes: 5 additions & 2 deletions .jenkinsci/release-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def doReleaseBuild() {
sh "mv /tmp/${GIT_COMMIT}-${BUILD_NUMBER}/iroha.deb /tmp/${env.GIT_COMMIT}"
sh "chmod +x /tmp/${env.GIT_COMMIT}/entrypoint.sh"
iCRelease = docker.build("${DOCKER_REGISTRY_BASENAME}:${GIT_COMMIT}-${BUILD_NUMBER}-release", "--no-cache -f /tmp/${env.GIT_COMMIT}/Dockerfile /tmp/${env.GIT_COMMIT}")
if (env.GIT_LOCAL_BRANCH == 'develop') {

// push Docker image in case the current branch is develop,
// or it is a commit into PR which base branch is develop (usually develop -> master)
if (GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH == 'develop') {
iCRelease.push("${platform}-develop")
if (manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop",
Expand All @@ -77,7 +80,7 @@ def doReleaseBuild() {
}
}
}
else if (env.GIT_LOCAL_BRANCH == 'master') {
else if (GIT_LOCAL_BRANCH == 'master') {
iCRelease.push("${platform}-latest")
if (manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:latest",
Expand Down

0 comments on commit 3e27259

Please sign in to comment.