From 61243297086b43caaae9582b7001d114f89113ee Mon Sep 17 00:00:00 2001 From: VIPIN Date: Tue, 9 Sep 2025 22:33:34 +0530 Subject: [PATCH] Remove NodeJS reference for Windows Minikube pipeline --- Jenkinsfile | 98 ++++++++++------------------------------------------- 1 file changed, 18 insertions(+), 80 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 43adc31..b91574b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,86 +1,24 @@ pipeline { - agent any + agent any - tools { - + environment { + DOCKERHUB_REPO = "vipin2025devops/myapp" + IMAGE_TAG = "${env.BUILD_NUMBER}" + } + + stages { + stage('Checkout') { + steps { + checkout scm + } } + + // Build, push, deploy stages... + } - environment { - WEB_IP = '13.49.223.142' // EC2 web server IP - SSH_USER = 'deploy' // Deploy user - SSH_KEY_PATH = '/home/ubuntu/.ssh/jenkins-deploy' // Path to private key on Jenkins server - NODE_OPTIONS = "--max_old_space_size=512" - } - - stages { - stage('Checkout') { - steps { - checkout scm - } - } - - stage('Install') { - steps { - sh ''' - echo "📦 Installing dependencies..." - npm ci - ''' - } - } - - stage('Build') { - steps { - sh ''' - echo "🏗️ Building project..." - npm run build - ''' - } - } - - stage('Package') { - steps { - sh ''' - OUT_DIR="build" - [ -d dist ] && OUT_DIR="dist" - - if [ ! -d "$OUT_DIR" ]; then - echo "❌ ERROR: No build output found (build/ or dist/)" - ls -la - exit 1 - fi - - echo "📦 Packaging build output..." - tar -czf build.tar.gz -C "$OUT_DIR" . - ''' - archiveArtifacts artifacts: 'build.tar.gz' - } - } - - stage('Deploy') { - steps { - script { - sh """ - echo "🚀 Deploying to ${WEB_IP}..." - - # Copy build to remote server - scp -i ${SSH_KEY_PATH} -o StrictHostKeyChecking=no build.tar.gz ${SSH_USER}@${WEB_IP}:/tmp/build.tar.gz - - # Deploy remotely - ssh -i ${SSH_KEY_PATH} -o StrictHostKeyChecking=no ${SSH_USER}@${WEB_IP} ' - mkdir -p ~/reactapp - rm -rf ~/reactapp/* - tar -xzf /tmp/build.tar.gz -C ~/reactapp - ' - - echo "✅ Deployment finished" - """ - } - } - } - } - - post { - success { echo "✅ Pipeline completed successfully" } - failure { echo "❌ Pipeline failed — check console log" } + post { + always { + echo "Pipeline finished: ${currentBuild.fullDisplayName}" } + } }