From caa1a1b4ca0582372a41696fd372f24c53ecef59 Mon Sep 17 00:00:00 2001 From: hllvc Date: Sun, 11 Jul 2021 12:19:01 +0200 Subject: [PATCH] jenkins fixup --- Jenkinsfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2002cc8cf..64c3f8182 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,10 @@ pipeline { stages { + stage('Clone Repo') { + checkout scm + } + stage('Build') { agent { dockerfile { @@ -25,14 +29,17 @@ pipeline { } stage('Run') { - agent { - dockerfile { - filename 'Dockerfile.run' - args '-v $HOME/.m2:/root/.m2 -v $HOME/app:/root/app --network petclinic -t petclinic-app' - } - } + def app = docker.build('petclinic-app:${env.BUILD_ID}', '-f Dockerfile.run') + app.push() + app.push('latest') + /* agent { */ + /* dockerfile { */ + /* filename 'Dockerfile.run' */ + /* args '-v $HOME/.m2:/root/.m2 -v $HOME/app:/root/app --network petclinic -t petclinic-app' */ + /* } */ + /* } */ steps { - sh 'docker run --network petclinic -p8080:3000 -v $HOME/app:/root/app petclinic-app' + sh 'docker run --network petclinic -p8080:3000 -v $HOME/app:/root/app petclinic-app:latest' } }