From af78bcdf1e7be047fe39fa1e44b6010c1e0c5e1f Mon Sep 17 00:00:00 2001 From: Nana Janashia Date: Sat, 7 Nov 2020 15:45:27 +0000 Subject: [PATCH] Add new file --- script.groovy | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 script.groovy diff --git a/script.groovy b/script.groovy new file mode 100644 index 0000000..79ddb88 --- /dev/null +++ b/script.groovy @@ -0,0 +1,19 @@ +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 \ No newline at end of file