From 2fa96e91238c1f2c185a784ee233001f6eedb9d4 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 9 Nov 2022 10:08:13 +0400 Subject: [PATCH] fix jenkinsfile --- Jenkinsfile | 70 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 34b79fd..e111338 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,62 @@ -node { - def app +// node { +// def app +// +// stage('Clone repository') { +// checkout scm +// } +// +// stage('Build image') { +// app = docker.build("romanov73/is:ng-tracker-container-11") +// } +// +// stage('Test image') { +// sh ./gradlew bootRun -Dng-tracker.check-run=true +// app.inside { +// sh 'echo "Tests passed"' +// } +// } +// } +// +// pipeline { +// agent none stages { +// stage('Maven Install') { +// agent { +// docker { +// image 'romanov73/is:ng-tracker-container-11' +// } +// } +// steps { +// sh 'sh ./gradlew bootRun -Dng-tracker.check-run=true' +// } +// } +// stage('Docker Build') { +// agent any +// steps { +// sh 'docker build -t shanem/spring-petclinic:latest .' +// } +// } +// } +// } - stage('Clone repository') { - checkout scm +pipeline { + environment { + imagename = "romanov73/is:ng-tracker-container-11" + registryCredential = '' + dockerImage = '' } - - stage('Build image') { - app = docker.build("romanov73/is:ng-tracker-container-11") - } - - stage('Test image') { - sh ./gradlew bootRun -Dng-tracker.check-run=true - app.inside { - sh 'echo "Tests passed"' + agent any + stages { + stage('Cloning Git') { + steps { + git([url: 'https://git.athene.tech/romanov73/example-web.git', branch: 'master']) + } + } + stage('Building image') { + steps{ + script { + dockerImage = docker.build imagename + } + } } } } \ No newline at end of file