From bef66b64f08e3a42416b8918d283591428142b5c Mon Sep 17 00:00:00 2001 From: VIPIN Date: Thu, 11 Sep 2025 10:11:02 +0530 Subject: [PATCH] Fix Jenkinsfile after merge conflict --- Jenkinsfile | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index aee0683..01b0709 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,48 +1,31 @@ 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 + environment { DOCKERHUB_REPO = "vipin2025devops/myapp" IMAGE_TAG = "${env.BUILD_NUMBER}" } + stages { stage('Checkout') { - steps { checkout scm } + steps { + checkout scm + } } + stage('Build & Push Image') { steps { script { docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-creds') { def img = docker.build("${DOCKERHUB_REPO}:${IMAGE_TAG}") img.push() + // cleanup local image to save space bat "docker image rm ${DOCKERHUB_REPO}:${IMAGE_TAG} || exit 0" } } } } + stage('Deploy to Kubernetes') { steps { 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}" + } + } }