updated jenkinsfile
Some checks failed
reactjs-node-project/pipeline/head There was a failure building this commit
Some checks failed
reactjs-node-project/pipeline/head There was a failure building this commit
This commit is contained in:
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
@@ -13,11 +13,8 @@
|
||||
// =============================================================================
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
agent wnode
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Environment variables - sensitive values come from Jenkins Credentials
|
||||
// -------------------------------------------------------------------------
|
||||
environment {
|
||||
DOCKER_HUB_USER = 'subkamble'
|
||||
BACKEND_IMAGE = "${DOCKER_HUB_USER}/react-mysql-backend"
|
||||
@@ -46,9 +43,6 @@ pipeline {
|
||||
|
||||
stages {
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 1: Checkout & Metadata
|
||||
// =====================================================================
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
@@ -61,9 +55,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 2: Install Dependencies & Lint
|
||||
// =====================================================================
|
||||
stage('Install & Lint') {
|
||||
parallel {
|
||||
stage('Backend - Install') {
|
||||
@@ -83,9 +74,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 3: Test
|
||||
// =====================================================================
|
||||
stage('Test') {
|
||||
parallel {
|
||||
stage('Backend - Test') {
|
||||
@@ -107,9 +95,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 4: Docker Build (all branches)
|
||||
// =====================================================================
|
||||
stage('Docker Build') {
|
||||
parallel {
|
||||
stage('Build Backend') {
|
||||
@@ -129,9 +114,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 5: Docker Push (main + staging branches only)
|
||||
// =====================================================================
|
||||
stage('Docker Push') {
|
||||
when {
|
||||
expression { env.IS_DEPLOYABLE == 'true' }
|
||||
@@ -170,13 +152,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 6: Deploy to Kubernetes
|
||||
//
|
||||
// main → onpremise overlay (production)
|
||||
// staging → minikube overlay (staging / dev cluster)
|
||||
// =====================================================================
|
||||
stage('Deploy') {
|
||||
when {
|
||||
expression { env.IS_DEPLOYABLE == 'true' }
|
||||
@@ -212,9 +187,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// STAGE 7: Smoke Test (post-deploy health check)
|
||||
// =====================================================================
|
||||
stage('Smoke Test') {
|
||||
when {
|
||||
expression { env.IS_DEPLOYABLE == 'true' }
|
||||
@@ -240,9 +212,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// POST Actions
|
||||
// =========================================================================
|
||||
post {
|
||||
always {
|
||||
// Clean up dangling local Docker images to save disk space
|
||||
@@ -268,16 +237,6 @@ pipeline {
|
||||
}
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// =============================================================================
|
||||
//
|
||||
// ██████╗ ██╗████████╗ ██████╗ ██████╗ ███████╗ ██████╗ █████╗ ████████╗
|
||||
// ██╔════╝ ██║╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝ ██╔══██╗██╔══██╗╚══██╔══╝
|
||||
// ██║ ███╗██║ ██║ ██║ ██║██████╔╝███████╗ ██║ ██║███████║ ██║
|
||||
// ██║ ██║██║ ██║ ██║ ██║██╔═══╝ ╚════██║ ██║ ██║██╔══██║ ██║
|
||||
// ╚██████╔╝██║ ██║ ╚██████╔╝██║ ███████║ ██████╔╝██║ ██║ ██║
|
||||
// ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
|
||||
//
|
||||
// GITOPS / ARGOCD WORKFLOW (commented out — activate when ArgoCD is installed)
|
||||
// =============================================================================
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user