Update Jenkinsfile

This commit is contained in:
senatorovv 2023-07-12 11:36:00 +04:00 committed by GitHub
parent 0743af783d
commit 51792db927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

41
Jenkinsfile vendored
View file

@ -1,43 +1,16 @@
#!groovy
pipeline {
environment {
dockerimagename = "bravinwasike/react-app"
dockerImage = ""
}
agent any
agent none
stages {
stage('Build image') {
steps{
script {
dockerImage = docker.build dockerimagename
stage('Maven Install') {
agent {
docker {
image 'maven:3.5.0'
}
}
}
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 {
script {
kubernetesDeploy(configs: "deployment.yaml", "service.yaml")
}
sh 'mvn clean install'
}
}
}
}