FirmTracker-Server/JenkinsFile
2024-12-05 18:27:26 +01:00

27 lines
836 B
Plaintext

pipeline {
agent any
environment {
IMG_NAME = 'firmtracker-server'
DOCKER_REPO = 'maciejm0101/firmtracker'
}
stages {
stage('build') {
steps {
script {
sh 'docker build -t ${IMG_NAME} .'
sh 'docker tag ${IMG_NAME} ${DOCKER_REPO}:${IMG_NAME}'
}
}
}
stage('push') {
steps {
withCredentials([usernamePassword(credentialsId: 'DockerHub-LG', passwordVariable: 'PSWD', usernameVariable: 'LOGIN')]) {
script {
sh 'echo ${PSWD} | docker login -u ${LOGIN} --password-stdin'
sh 'docker push ${DOCKER_REPO}:${IMG_NAME}'
}
}
}
}
}
}