Update Jenkinsfile

This commit is contained in:
Sanjeev435 2018-12-09 14:47:29 +05:30 committed by GitHub
parent ea358e14ba
commit 2808f362b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

44
Jenkinsfile vendored
View file

@ -1,39 +1,7 @@
#!groovy library 'my-shared-library'
pipeline { myDeliveryPipeline(branch: 'master', scmUrl: 'ssh://git@myScmServer.com/repos/myRepo.git',
agent none email: 'mrcool435@gmail.com', serverPort: '8080',
stages { developmentServer: 'dev-myproject.mycompany.com',
stage('Maven Install') { stagingServer: 'staging-myproject.mycompany.com',
agent { productionServer: 'production-myproject.mycompany.com')
docker {
image 'maven:3.5.4-jdk-8-alpine'
}
}
steps {
sh 'mvn clean install -Dmaven.test.skip=true'
}
}
stage('Run tests') {
agent any
steps {
sh 'mvn clean install -Dmaven.test.skip=true'
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build -t sanjeev435/spring-petclinic:latest .'
}
}
stage('Docker Push') {
agent any
steps {
withCredentials([usernamePassword(credentialsId: 'DOCKER_HUB_GLOBAL', passwordVariable: 'dockerHubPassword',
usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
sh 'docker push sanjeev435/spring-petclinic'
}
}
}
}
}