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
69 changes: 69 additions & 0 deletions Jenkinsfile1
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
pipeline {
agent any

tools {
jdk 'jdk17'
nodejs 'node20'
}

environment {
SCANNER_HOME= tool 'sonar-scanner'
}
stages {
stage('Git Checkout') {
steps {
git branch: 'main', url: 'https://github.com/praks7v/fullstack-bank.git'
}
}

stage('OWASP FS Scan') {
steps {
dependencyCheck additionalArguments: '--scan ./app/backend --disableYarnAudit --disableNodeAudit' , odcInstallation: 'DC'
dependencyCheckPublisher pattern: '**/dependency-check-report.xml'
}
}

stage('Trivy FS Scan') {
steps {
sh "trivy fs ."
}
}

stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('sonar') {
sh "$SCANNER_HOME/bin/sonar-scanner -Dsonar.projectName=Bank -Dsonar.projectKey=Bank"

}
}
}

stage('Install Dependency') {
steps {
sh "npm install"
}
}

stage('Backend') {
steps {
dir('app/backend') {
sh "npm install"
}
}
}

stage('Frontend') {
steps {
dir('app/frontend'){
sh "npm install"
}
}
}

stage("Deploy to Container"){
steps {
sh "npm run compose:up -d"
}
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"test:e2e:open": "cypress open --browser electron --e2e",
"test:integration": "cd app/backend && npm i && npm run test:coverage",
"test": "npm run test:e2e && npm run test:integration",
"compose:up": "cd app && docker-compose up -d",
"compose:up:build": "cd app && docker-compose up -d --build",
"compose:down": "cd app && docker-compose down --remove-orphans",
"compose:up": "cd app && docker compose up -d",
"compose:up:build": "cd app && docker compose up -d --build",
"compose:down": "cd app && docker compose down --remove-orphans",
"postinstall": "cd app/backend && npm i && cd ../frontend && npm i"
},
"author": "Raphael Martins",
Expand Down