call library functions in jenkinsfile

This commit is contained in:
Nana Janashia
2020-11-08 15:58:31 +01:00
parent d7839d4033
commit 6a5572a5f7
2 changed files with 10 additions and 25 deletions

View File

@@ -1,19 +1,5 @@
def buildJar() {
echo "building the application..."
sh 'mvn package'
}
def buildImage() {
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'
}
}
def deployApp() {
echo 'deploying the application...'
}
}
return this
return this