Fix Jenkinsfile after merge conflict
This commit is contained in:
parent
933c2ee903
commit
bef66b64f0
41
Jenkinsfile
vendored
41
Jenkinsfile
vendored
@ -1,48 +1,31 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
<<<<<<< HEAD
|
|
||||||
agent any
|
|
||||||
|
|
||||||
environment {
|
|
||||||
DOCKERHUB_REPO = "vipin2025devops/myapp"
|
|
||||||
IMAGE_TAG = "${env.BUILD_NUMBER}"
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Checkout') {
|
|
||||||
steps {
|
|
||||||
checkout scm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build, push, deploy stages...
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
echo "Pipeline finished: ${currentBuild.fullDisplayName}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
=======
|
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
DOCKERHUB_REPO = "vipin2025devops/myapp"
|
DOCKERHUB_REPO = "vipin2025devops/myapp"
|
||||||
IMAGE_TAG = "${env.BUILD_NUMBER}"
|
IMAGE_TAG = "${env.BUILD_NUMBER}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps { checkout scm }
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build & Push Image') {
|
stage('Build & Push Image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-creds') {
|
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-creds') {
|
||||||
def img = docker.build("${DOCKERHUB_REPO}:${IMAGE_TAG}")
|
def img = docker.build("${DOCKERHUB_REPO}:${IMAGE_TAG}")
|
||||||
img.push()
|
img.push()
|
||||||
|
// cleanup local image to save space
|
||||||
bat "docker image rm ${DOCKERHUB_REPO}:${IMAGE_TAG} || exit 0"
|
bat "docker image rm ${DOCKERHUB_REPO}:${IMAGE_TAG} || exit 0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy to Kubernetes') {
|
stage('Deploy to Kubernetes') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([file(credentialsId: 'kubeconfig', variable: 'KUBECONFIG')]) {
|
withCredentials([file(credentialsId: 'kubeconfig', variable: 'KUBECONFIG')]) {
|
||||||
@ -57,6 +40,10 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post { always { echo "Pipeline finished: ${currentBuild.fullDisplayName}" } }
|
|
||||||
>>>>>>> 19a245e (Update message for Jenkins + Minikube pipeline test)
|
post {
|
||||||
|
always {
|
||||||
|
echo "Pipeline finished: ${currentBuild.fullDisplayName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user