32 lines
639 B
Groovy
32 lines
639 B
Groovy
pipeline {
|
|
agent any
|
|
options {
|
|
buildDiscarder(logRotator(numToKeepStr: '5'))
|
|
}
|
|
environment {
|
|
DOCKERHUB_CREDENTIALS = credentials('dockerhub')
|
|
}
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
sh 'whoami'
|
|
sh 'docker build -t buzzerburger/test:latest ./app'
|
|
}
|
|
}
|
|
// stage('Login') {
|
|
// steps {
|
|
// sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin'
|
|
//}
|
|
//}
|
|
stage('Push') {
|
|
steps {
|
|
sh 'docker push buzzerburger/test:latest'
|
|
}
|
|
}
|
|
}
|
|
// post {
|
|
// always {
|
|
// sh 'docker logout'
|
|
//}
|
|
//}
|
|
} |