MSPF-97: introduce containerpilot (#7)

This commit is contained in:
Anton Belyaev 2016-10-11 15:50:47 +03:00 committed by GitHub
parent 14b39673e3
commit 1709ca31ca
5 changed files with 26 additions and 7 deletions

View File

@ -3,7 +3,8 @@ cat <<EOF
FROM $BASE_IMAGE
MAINTAINER Igor Savchuk <i.savchuk@rbkmoney.com>
COPY _build/prod/rel/dominant /opt/dominant
CMD /opt/dominant/bin/dominant foreground
COPY containerpilot.json /etc/containerpilot.json
CMD /bin/containerpilot -config file:///etc/containerpilot.json /opt/dominant/bin/dominant foreground
EXPOSE 8022
# A bit of magic below to get a proper branch name
# even when the HEAD is detached (Hey Jenkins!

12
Jenkinsfile vendored
View File

@ -48,9 +48,15 @@ build('dominant', 'docker-host', finalHook) {
sh "make build_image"
}
if (env.BRANCH_NAME == 'master') {
runStage('push image') {
sh "make push_image"
try {
if (env.BRANCH_NAME == 'master') {
runStage('push image') {
sh "make push_image"
}
}
} finally {
runStage('rm local image') {
sh 'make rm_local_image'
}
}
}

View File

@ -14,8 +14,7 @@ SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
# Base image for the service
BASE_IMAGE_NAME := service_erlang
BASE_IMAGE_TAG := 2202a02cbcb71982fea2e901ffb2b1ca5da610ae
BASE_IMAGE_TAG := 4000337c0ca19978467f62ca6505a03c2569de40
## Variables required for utils_container.mk

@ -1 +1 @@
Subproject commit cb3389abfe0c0a969fa0415b15bf32b0a9005b4e
Subproject commit 4858499fdd62af516a2239d51d12d82be0921857

13
containerpilot.json Normal file
View File

@ -0,0 +1,13 @@
{
"consul": "{{ .CONSUL_ADDR }}:8500",
"services": [
{
"name": "dominant",
"port": 8022,
"health": "/usr/bin/curl --silent --show-error --output /dev/null localhost:8022",
"poll": 1,
"ttl": 2,
"interfaces": ["eth0"]
}
]
}