mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 01:05:48 +00:00
Update Jenkinsfile
This commit is contained in:
parent
0743af783d
commit
51792db927
1 changed files with 7 additions and 34 deletions
41
Jenkinsfile
vendored
41
Jenkinsfile
vendored
|
@ -1,43 +1,16 @@
|
||||||
|
#!groovy
|
||||||
pipeline {
|
pipeline {
|
||||||
|
agent none
|
||||||
environment {
|
|
||||||
dockerimagename = "bravinwasike/react-app"
|
|
||||||
dockerImage = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
agent any
|
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('Maven Install') {
|
||||||
stage('Build image') {
|
agent {
|
||||||
steps{
|
docker {
|
||||||
script {
|
image 'maven:3.5.0'
|
||||||
dockerImage = docker.build dockerimagename
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stage('Pushing Image') {
|
|
||||||
environment {
|
|
||||||
registryCredential = 'dockerhub-credentials'
|
|
||||||
}
|
|
||||||
steps{
|
|
||||||
script {
|
|
||||||
docker.withRegistry( 'https://registry.hub.docker.com', registryCredential ) {
|
|
||||||
dockerImage.push("latest")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploying React.js container to Kubernetes') {
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
sh 'mvn clean install'
|
||||||
kubernetesDeploy(configs: "deployment.yaml", "service.yaml")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue