Skip to content

Commit

Permalink
feat: add Install Dependencies stage to Jenkinsfile for Node.js setup…
Browse files Browse the repository at this point in the history
… and enhance cleanup process
  • Loading branch information
Ganthepro committed Dec 30, 2024
1 parent ae23cf2 commit 3ff7f2f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ pipeline {
// ใช้คำสั่ง sonar-scanner เพื่อทำการวิเคราะห์โค้ดของเรา
}
}

stage('Install Dependencies') {
steps {
nodejs(nodeJSInstallationName: 'nodejs') {
sh 'pnpm install'
}
}
}

stage('OWASP Dependency Check') {
steps {
Expand Down Expand Up @@ -86,10 +94,17 @@ pipeline {
}

post {
clearWs()
always {
sh 'echo y | docker system prune -a'
sh 'rm -rf edusaig-manifests'
// ใช้คำสั่ง docker rmi เพื่อทำการลบ image ที่เรา build และ push ไปยัง Docker Hub
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']])
}
}
}

0 comments on commit 3ff7f2f

Please sign in to comment.