2024-11-28 20:22:15 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
2024-12-05 18:27:26 +01:00
|
|
|
environment {
|
|
|
|
IMG_NAME = 'firmtracker-server'
|
|
|
|
DOCKER_REPO = 'maciejm0101/firmtracker'
|
|
|
|
}
|
2024-11-28 20:22:15 +01:00
|
|
|
stages {
|
2024-12-05 18:27:26 +01:00
|
|
|
stage('build') {
|
2024-11-28 20:22:15 +01:00
|
|
|
steps {
|
2024-12-05 18:27:26 +01:00
|
|
|
script {
|
|
|
|
sh 'docker build -t ${IMG_NAME} .'
|
|
|
|
sh 'docker tag ${IMG_NAME} ${DOCKER_REPO}:${IMG_NAME}'
|
|
|
|
}
|
2024-11-28 20:22:15 +01:00
|
|
|
}
|
|
|
|
}
|
2024-12-05 18:27:26 +01:00
|
|
|
stage('push') {
|
2024-12-05 19:16:58 +01:00
|
|
|
steps {
|
|
|
|
withCredentials([usernamePassword(credentialsId: 'DockerHub-LG', passwordVariable: 'PSWD', usernameVariable: 'LOGIN')]) {
|
2024-12-05 18:27:26 +01:00
|
|
|
script {
|
2024-12-05 19:16:58 +01:00
|
|
|
sh 'echo ${PSWD} | docker login -u ${LOGIN} --password-stdin'
|
|
|
|
sh 'docker push ${DOCKER_REPO}:${IMG_NAME}'
|
|
|
|
}
|
2024-12-05 18:27:26 +01:00
|
|
|
}
|
2024-11-28 20:22:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-12-05 18:27:26 +01:00
|
|
|
}
|