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 {
|
pipeline {
|
||||||
agent any
|
agent wnode
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
// Environment variables - sensitive values come from Jenkins Credentials
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
environment {
|
environment {
|
||||||
DOCKER_HUB_USER = 'subkamble'
|
DOCKER_HUB_USER = 'subkamble'
|
||||||
BACKEND_IMAGE = "${DOCKER_HUB_USER}/react-mysql-backend"
|
BACKEND_IMAGE = "${DOCKER_HUB_USER}/react-mysql-backend"
|
||||||
@@ -46,9 +43,6 @@ pipeline {
|
|||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 1: Checkout & Metadata
|
|
||||||
// =====================================================================
|
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
checkout scm
|
checkout scm
|
||||||
@@ -61,9 +55,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 2: Install Dependencies & Lint
|
|
||||||
// =====================================================================
|
|
||||||
stage('Install & Lint') {
|
stage('Install & Lint') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Backend - Install') {
|
stage('Backend - Install') {
|
||||||
@@ -83,9 +74,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 3: Test
|
|
||||||
// =====================================================================
|
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Backend - Test') {
|
stage('Backend - Test') {
|
||||||
@@ -107,9 +95,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 4: Docker Build (all branches)
|
|
||||||
// =====================================================================
|
|
||||||
stage('Docker Build') {
|
stage('Docker Build') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Build Backend') {
|
stage('Build Backend') {
|
||||||
@@ -129,9 +114,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 5: Docker Push (main + staging branches only)
|
|
||||||
// =====================================================================
|
|
||||||
stage('Docker Push') {
|
stage('Docker Push') {
|
||||||
when {
|
when {
|
||||||
expression { env.IS_DEPLOYABLE == 'true' }
|
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') {
|
stage('Deploy') {
|
||||||
when {
|
when {
|
||||||
expression { env.IS_DEPLOYABLE == 'true' }
|
expression { env.IS_DEPLOYABLE == 'true' }
|
||||||
@@ -212,9 +187,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================
|
|
||||||
// STAGE 7: Smoke Test (post-deploy health check)
|
|
||||||
// =====================================================================
|
|
||||||
stage('Smoke Test') {
|
stage('Smoke Test') {
|
||||||
when {
|
when {
|
||||||
expression { env.IS_DEPLOYABLE == 'true' }
|
expression { env.IS_DEPLOYABLE == 'true' }
|
||||||
@@ -240,9 +212,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================================
|
|
||||||
// POST Actions
|
|
||||||
// =========================================================================
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
// Clean up dangling local Docker images to save disk space
|
// 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)
|
// GITOPS / ARGOCD WORKFLOW (commented out — activate when ArgoCD is installed)
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user