Skip to content

Instantly share code, notes, and snippets.

@foxutech
Last active April 9, 2018 07:33
Show Gist options
  • Save foxutech/c3bfe009749c3ae43aec4417a11b4756 to your computer and use it in GitHub Desktop.
Save foxutech/c3bfe009749c3ae43aec4417a11b4756 to your computer and use it in GitHub Desktop.
node {
stage 'checkout'
git 'https://gitlab.com/motoskia/hello-world.git'
stage 'build'
sh 'mvn clean install'
stage('Results - 1') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
stage 'bake image'
docker.withRegistry('https://registry.hub.docker.com','docker-hub-credentials') {
def image = docker.build("foxutech/foxdevops:${env.BUILD_TAG}",'.')
stage 'test image'
image.withRun('-p 8888:8888') {springboot ->
sh 'while ! httping -qc1 http://localhost:8888/info; do sleep 1; done'
git 'https://github.com/motoskia/petclinicacceptance.git'
sh 'mvn clean verify'
}
stage('Results') {
junit '**/target/surefire-reports/TEST-*.xml'
archive 'target/*.jar'
}
stage 'push image'
image.push()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment