ewq
BOT_open_sesam/pipeline/head This commit looks good
Details
BOT_open_sesam/pipeline/head This commit looks good
Details
parent
7b6d298d68
commit
78c23227e4
|
|
@ -6,10 +6,17 @@ pipeline {
|
||||||
TUNNEL_IMAGE_NAME = "tunnel_open_sesam"
|
TUNNEL_IMAGE_NAME = "tunnel_open_sesam"
|
||||||
BOT_IMAGE_TAG = "latest"
|
BOT_IMAGE_TAG = "latest"
|
||||||
TUNNEL_IMAGE_TAG = "latest"
|
TUNNEL_IMAGE_TAG = "latest"
|
||||||
|
IMAGE_TAG = "${env.BUILD_NUMBER}"
|
||||||
}
|
}
|
||||||
|
|
||||||
agent { label 'agent_smith'}
|
agent { label 'agent_smith'}
|
||||||
|
|
||||||
|
options {
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
|
disableConcurrentBuilds() // Prevent cleanup conflicts
|
||||||
|
timeout(time: 30, unit: 'MINUTES')
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage ('build bot image and push') {
|
stage ('build bot image and push') {
|
||||||
|
|
@ -17,7 +24,10 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
docker.withRegistry("${REGISTRY_URL}", 'jenkins_harbor') {
|
docker.withRegistry("${REGISTRY_URL}", 'jenkins_harbor') {
|
||||||
def BotImage = docker.build(
|
def BotImage = docker.build(
|
||||||
"${REGISTRY}/${BOT_IMAGE_NAME}:${BOT_IMAGE_TAG}"
|
"${REGISTRY}/${BOT_IMAGE_NAME}:${env.BUILD_NUMBER}",
|
||||||
|
"--label build_number=${IMAGE_TAG} " +
|
||||||
|
"--label git_commit=${env.GIT_COMMIT} " +
|
||||||
|
"."
|
||||||
)
|
)
|
||||||
BotImage.push()
|
BotImage.push()
|
||||||
}
|
}
|
||||||
|
|
@ -30,7 +40,10 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
docker.withRegistry("${REGISTRY_URL}", 'jenkins_harbor') {
|
docker.withRegistry("${REGISTRY_URL}", 'jenkins_harbor') {
|
||||||
def TunnelImage = docker.build(
|
def TunnelImage = docker.build(
|
||||||
"${REGISTRY}/${TUNNEL_IMAGE_NAME}:${TUNNEL_IMAGE_TAG}"
|
"${REGISTRY}/${TUNNEL_IMAGE_NAME}:${env.BUILD_NUMBER}",
|
||||||
|
"--label build_number=${IMAGE_TAG} " +
|
||||||
|
"--label git_commit=${env.GIT_COMMIT} " +
|
||||||
|
"."
|
||||||
)
|
)
|
||||||
TunnelImage.push()
|
TunnelImage.push()
|
||||||
}
|
}
|
||||||
|
|
@ -51,8 +64,15 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh '''
|
sh '''
|
||||||
docker-compose pull
|
export BOT_IMAGE_TAG=${IMAGE_TAG}
|
||||||
docker-compose up -d
|
export TUNNEL_IMAGE_TAG=${IMAGE_TAG}
|
||||||
|
|
||||||
|
# Pull new images explicitly
|
||||||
|
docker-compose pull bot_open_sesam tunnel_open_sesam
|
||||||
|
|
||||||
|
# Deploy with specific project name
|
||||||
|
docker-compose up -d --remove-orphans
|
||||||
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ version: '3'
|
||||||
services:
|
services:
|
||||||
bot_open_sesam:
|
bot_open_sesam:
|
||||||
container_name: bot_open_sesam
|
container_name: bot_open_sesam
|
||||||
image: proxy.docker.dataekb.ru/local_cache/bot_open_sesam:latest
|
image: proxy.docker.dataekb.ru/local_cache/bot_open_sesam:${BOT_IMAGE_TAG:-latest}
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
env_file:
|
env_file:
|
||||||
|
|
@ -19,7 +19,7 @@ services:
|
||||||
max-size: "10m"
|
max-size: "10m"
|
||||||
max-file: "3"
|
max-file: "3"
|
||||||
tunnel_open_sesam:
|
tunnel_open_sesam:
|
||||||
image: proxy.docker.dataekb.ru/local_cache/tunnel_open_sesam:latest
|
image: proxy.docker.dataekb.ru/local_cache/tunnel_open_sesam:${BOT_IMAGE_TAG:-latest}
|
||||||
container_name: tunnel_open_sesam
|
container_name: tunnel_open_sesam
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue