fix jenkinsfile

This commit is contained in:
Anton Romanov 2022-11-09 10:08:13 +04:00
parent f89c2032c6
commit 2fa96e9123

70
Jenkinsfile vendored
View File

@ -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
}
}
}
}
}