-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (28 loc) · 955 Bytes
/
Jenkinsfile
File metadata and controls
29 lines (28 loc) · 955 Bytes
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
pipeline {
agent{
node "host-node"
}
stages {
stage('check out') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'GitHub_jtdotcode', url: 'https://github.com/jtdotcode/devicedb.git']]])
}
}// end hello
stage('Copy config.env') {
steps {
sh "cp /var/lib/jenkins/config.env ${env.WORKSPACE}/config.env"
}
} // end copy config.env
stage('Build') {
steps {
sh 'npm run build'
}
} // end build
stage('Deploy') {
steps {
sh 'sudo pm2 delete device_db'
sh "sudo pm2 start ${env.WORKSPACE}/server.js --name device_db"
}
} // end deploy
} //end stages
} //end pipeline