fix
This commit is contained in:
34
Jenkinsfile-v3
Normal file
34
Jenkinsfile-v3
Normal file
@@ -0,0 +1,34 @@
|
||||
def gv
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("build jar") {
|
||||
steps {
|
||||
script {
|
||||
echo "building the application..."
|
||||
sh 'mvn package'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("build image") {
|
||||
steps {
|
||||
script {
|
||||
echo "building the docker image..."
|
||||
withCredentials([usernamePassword(credentialsId: 'docker-hub-repo', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
|
||||
sh 'docker build -t nanajanashia/demo-app:jma-2.0 .'
|
||||
sh "echo $PASS | docker login -u $USER --password-stdin"
|
||||
sh 'docker push nanajanashia/demo-app:jma-2.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("deploy") {
|
||||
steps {
|
||||
script {
|
||||
echo 'deploying the application...'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user