Upload files to ''

This commit is contained in:
2022-04-20 04:20:25 +00:00
parent e34c6e1cdf
commit 55534b191d
Vendored
+31
View File
@@ -0,0 +1,31 @@
pipeline {
agent { label 'linux' }
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
environment {
DOCKERHUB_CREDENTIALS = credentials('dockerhub')
}
stages {
stage('Build') {
steps {
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'
}
}
}