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 { // node {
def app // 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') { pipeline {
checkout scm environment {
imagename = "romanov73/is:ng-tracker-container-11"
registryCredential = ''
dockerImage = ''
} }
agent any
stage('Build image') { stages {
app = docker.build("romanov73/is:ng-tracker-container-11") stage('Cloning Git') {
} steps {
git([url: 'https://git.athene.tech/romanov73/example-web.git', branch: 'master'])
stage('Test image') { }
sh ./gradlew bootRun -Dng-tracker.check-run=true }
app.inside { stage('Building image') {
sh 'echo "Tests passed"' steps{
script {
dockerImage = docker.build imagename
}
}
} }
} }
} }