refs #5541 Tag image
gitea/mylogger/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-04-11 13:36:57 +02:00
parent aa2328db65
commit 610f90c662
2 changed files with 6 additions and 1 deletions

5
Jenkinsfile vendored
View File

@ -22,12 +22,17 @@ pipeline {
stage('Build') {
when {branch 'master'}
environment {
IMAGE = 'registry.verdnatura.es/mylogger'
TAG = "${env.VERSION}-build${env.BUILD_ID}"
CREDENTIALS = credentials('docker-registry')
}
steps {
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
sh 'docker-compose push'
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker push $IMAGE:latest'
}
}
}

View File

@ -1,7 +1,7 @@
version: '3.7'
services:
main:
image: registry.verdnatura.es/mylogger:${VERSION}-build${BUILD_ID}
image: registry.verdnatura.es/mylogger:${TAG:-latest}
build:
context: .
dockerfile: Dockerfile