forked from olorunfemi007/nodejs-application
-
Notifications
You must be signed in to change notification settings - Fork 1
/
JenkinsfileScripted
42 lines (34 loc) · 912 Bytes
/
JenkinsfileScripted
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
node
{
stage("CheckOutCodeGit")
{
sh "echo 'cloning the latest application version' "
git credentialsId: '1e33a549-25a6-4149-aefb-8846762d3566', url: 'https://github.com/olorunfemi007/nodejs-application.git'}
stage("Build")
{
nodejs(nodeJSInstallationName: 'nodejs20.3.1') {
sh 'npm install'
}
}
stage('ExecuteSonarQubeReport') {
nodejs(nodeJSInstallationName: 'nodejs20.3.1') {
sh 'npm run sonar'
}
}
stage('UploadintoNexus') {
nodejs(nodeJSInstallationName: 'nodejs20.3.1') {
sh 'chmod u+x ./scripts/nexus.sh'
sh './scripts/nexus.sh'
sh 'npm publish'
}
}
stage('RunNodeJsApp')
{
//sh "./scripts/run.sh"
nodejs(nodeJSInstallationName: 'nodejs20.3.1') {
sh 'chmod u+x ./scripts/runApp.sh'
sh './scripts/runApp.sh'
// sh 'npm start &'
}
}
}