feat: jenkins push docker imagen by branch
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2024-07-19 13:11:26 +02:00
parent 6aab5fa9ef
commit 23e2c9890f
1 changed files with 9 additions and 0 deletions

9
Jenkinsfile vendored
View File

@ -89,6 +89,11 @@ pipeline {
sh 'pnpm install --prefer-offline --prefix=front'
}
}
stage('Push image') {
steps {
sh 'docker tag $IMAGE:$TAG $IMAGE:$BRANCH_NAME'
}
}
}
}
stage('Stack') {
@ -183,6 +188,10 @@ pipeline {
}
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
sh 'docker-compose push'
if (env.BRANCH_NAME == 'master') {
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker push $IMAGE:latest'
}
}
}
stage('Deploy') {