-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from devicehive/development
Development
- Loading branch information
Showing
7 changed files
with
430 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
properties([ | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '32', daysToKeepStr: '', numToKeepStr: '100')) | ||
]) | ||
|
||
def publishable_branches = ["development", "master"] | ||
|
||
node('docker') { | ||
stage('Build and publish Docker images in CI repository') { | ||
checkout scm | ||
echo 'Building image ...' | ||
def DevicehivePluginCassandraNode = docker.build('devicehiveci/devicehive-plugin-cassandra-node:${BRANCH_NAME}', '--pull -f Dockerfile .') | ||
|
||
echo 'Pushing image to CI repository ...' | ||
docker.withRegistry('https://registry.hub.docker.com', 'devicehiveci_dockerhub'){ | ||
DevicehivePluginCassandraNode.push() | ||
} | ||
} | ||
} | ||
|
||
if (publishable_branches.contains(env.BRANCH_NAME)) { | ||
node('docker') { | ||
stage('Publish image in main repository') { | ||
// Builds from 'master' branch will have 'latest' tag | ||
def IMAGE_TAG = (env.BRANCH_NAME == 'master') ? 'latest' : env.BRANCH_NAME | ||
|
||
docker.withRegistry('https://registry.hub.docker.com', 'devicehiveci_dockerhub'){ | ||
sh """ | ||
docker tag devicehiveci/devicehive-plugin-cassandra-node:${BRANCH_NAME} registry.hub.docker.com/devicehive/devicehive-plugin-cassandra-node:${IMAGE_TAG} | ||
docker push registry.hub.docker.com/devicehive/devicehive-plugin-cassandra-node:${IMAGE_TAG} | ||
""" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.