Add the repo to Jenkins

This commit is contained in:
Anton Belyaev 2017-01-26 17:30:53 +03:00 committed by Anton Belyaev
parent 1c1042911f
commit 9edc7ac8ea
3 changed files with 33 additions and 1 deletions

31
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,31 @@
#!groovy
build('registrator', 'docker-host') {
checkoutRepo()
runStage('build') {
env.IMG_TAG = sh(script: "cat VERSION", returnStdout: true).trim()
sh "make build"
}
try {
if (env.BRANCH_NAME == 'master') {
runStage('push image') {
getCommitId()
sh 'docker tag registrator:$IMG_TAG dr.rbkmoney.com/registrator:$COMMIT_ID'
try {
docker.withRegistry('https://dr.rbkmoney.com/v2/', 'dockerhub-rbkmoneycibot') {
sh 'docker push dr.rbkmoney.com/registrator:$COMMIT_ID'
}
} finally {
sh 'docker rmi -f dr.rbkmoney.com/registrator:$COMMIT_ID'
}
}
}
} finally {
runStage('rm local image') {
sh 'docker rmi -f registrator:$IMG_TAG'
}
}
}

View File

@ -10,7 +10,7 @@ dev:
build:
mkdir -p build
docker build -t $(NAME):$(VERSION) .
docker build --force-rm -t $(NAME):$(VERSION) .
docker save $(NAME):$(VERSION) | gzip -9 > build/$(NAME)_$(VERSION).tgz
release:

View File

@ -5,6 +5,7 @@ Service registry bridge for Docker.
[![Circle CI](https://circleci.com/gh/gliderlabs/registrator.png?style=shield)](https://circleci.com/gh/gliderlabs/registrator)
[![Docker pulls](https://img.shields.io/docker/pulls/gliderlabs/registrator.svg)](https://hub.docker.com/r/gliderlabs/registrator/)
[![IRC Channel](https://img.shields.io/badge/irc-%23gliderlabs-blue.svg)](https://kiwiirc.com/client/irc.freenode.net/#gliderlabs)
[![Build Status](http://ci.rbkmoney.com/buildStatus/icon?job=rbkmoney_private/registrator/master)](http://ci.rbkmoney.com/job/rbkmoney_private/job/registrator/job/master/)
<br /><br />
Registrator automatically registers and deregisters services for any Docker