This commit is contained in:
parent
aa2328db65
commit
610f90c662
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue