From f160171b74703b93d2736fd7e3910039ed64b0c9 Mon Sep 17 00:00:00 2001 From: Praks <70097213+praks7v@users.noreply.github.com> Date: Sat, 1 Jun 2024 14:58:56 +0530 Subject: [PATCH 1/2] Update package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e3bdd0e..f0c4410 100644 --- a/package.json +++ b/package.json @@ -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", From 973bf1dfec25ebfa887fd85e50b48206a3bd8c06 Mon Sep 17 00:00:00 2001 From: Praks <70097213+praks7v@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:23:47 +0530 Subject: [PATCH 2/2] Create Jenkinsfile1 --- Jenkinsfile1 | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Jenkinsfile1 diff --git a/Jenkinsfile1 b/Jenkinsfile1 new file mode 100644 index 0000000..6e08031 --- /dev/null +++ b/Jenkinsfile1 @@ -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" + } + } + } +}