forked from LandmakTechnology/nodejs-application
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jenkinsfile-nodejs
54 lines (45 loc) · 1.49 KB
/
jenkinsfile-nodejs
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
43
44
45
46
47
48
49
50
51
52
53
54
node
{
stage("CheckOutCodeGit")
{
sh "echo running ebay nodeJS project"
git "https://github.com/dizzy-101/nodejs-application"
}
stage("Build"){
nodejs(nodeJSInstallationName: 'nodejs17') {
sh 'npm install'
}
}
stage('ExecuteSonarQubeReport') {
nodejs(nodeJSInstallationName: 'nodejs17') {
sh 'npm run sonar'
sh "echo QA of nodeJS project Begins"
}
}
stage('UploadingtoNexus') {
nodejs(nodeJSInstallationName: 'nodejs17') {
//nexusArtifactUploader credentialsId: 'nexus id', groupId: '1', nexusUrl: '54.209.219.41:8081/klik', nexusVersion: 'nexus3', protocol: 'http', repository: 'https://54.209.219.41:8081/klik/repository/akugbe_nodejs/', version: '3.59.0-01'
sh "echo backup of nodejs project"
//sh 'chmod u+x ./scripts/nexus.sh'
//sh './scripts/nexus.sh'
sh 'npm publish'
}
}
stage('6.ManualApproval'){
nodejs(nodeJSInstallationName: 'nodejs17'){
sh "echo 'Please review the application performance.' "
timeout(time:600, unit:'MINUTES') {
input message: 'Application ready for deployment, Please review and approve'
}
}
}
stage('RunNodeJsApp') {
nodejs(nodeJSInstallationName: 'nodejs17') {
//sh 'npm start'
sh "echo START nodeJS project"
sh 'chmod u+x ./scripts/runApp.sh'
sh './scripts/runApp.sh'
//sh 'npm start &'
}
}
}