Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions Jenkinsfile_CI

This file was deleted.

10 changes: 5 additions & 5 deletions api/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=Aditya
DB_NAME=crud_app
JWT_SECRET=devopsShackSuperSecretKey
#DB_HOST=localhost
#DB_USER=root
#DB_PASSWORD=Aditya
#DB_NAME=crud_app
#JWT_SECRET=devopsShackSuperSecretKey

56 changes: 56 additions & 0 deletions jenkins-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
pipeline {
agent any
tools {
nodejs 'nodejs25'
}

environment {
SCANNER_HOME = tool 'sonar-scanner'
}
stages {
stage('Git checkout') {
steps {
git branch: 'local-dev', url: 'https://github.com/dina0062/3-Tier-DevSecOps-Mega-Project.git'
}
}
stage('Frontend compilation') {
steps {
dir('client') {
sh 'find . -name "*.js" -exec node --check {} +'
}
}
}

stage('backend compilation') {
steps {
dir('api') {
sh 'find . -name "*.js" -exec node --check {} +'
}
}
}


stage('Sonar qube') {
steps {
withSonarQubeEnv('sonar') {
sh ''' $SCANNER_HOME/bin/sonar-scanner -Dsonar.projectName=NodeJS-PROJECT \
-Dsonar.projectKey=NodeJS-project '''
}
}
}

stage('Quality Gate Check') {
steps {
timeout(1) {
waitForQualityGate abortPipeline: false, credentialsId: 'sonar-token'
}
}
}

stage('trivy') {
steps {
sh 'trivy fs --format table -o fs-report.html .'
}
}
}
}