This commit is contained in:
parent
aa2328db65
commit
610f90c662
|
@ -22,12 +22,17 @@ pipeline {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
when {branch 'master'}
|
when {branch 'master'}
|
||||||
environment {
|
environment {
|
||||||
|
IMAGE = 'registry.verdnatura.es/mylogger'
|
||||||
|
TAG = "${env.VERSION}-build${env.BUILD_ID}"
|
||||||
CREDENTIALS = credentials('docker-registry')
|
CREDENTIALS = credentials('docker-registry')
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
|
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
|
||||||
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
|
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
|
||||||
sh 'docker-compose push'
|
sh 'docker-compose push'
|
||||||
|
|
||||||
|
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
|
||||||
|
sh 'docker push $IMAGE:latest'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: '3.7'
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
image: registry.verdnatura.es/mylogger:${VERSION}-build${BUILD_ID}
|
image: registry.verdnatura.es/mylogger:${TAG:-latest}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
Loading…
Reference in New Issue