-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile
More file actions
43 lines (40 loc) · 1.77 KB
/
Copy pathJenkinsfile
File metadata and controls
43 lines (40 loc) · 1.77 KB
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
pipeline {
agent any
environment {
root = "/data/www/"
}
parameters {
string(name: 'domain', defaultValue: 'iotpack.addpoints.cn', description: 'iotpack.addpoints.cn')
string(name: 'version', defaultValue: 'daily', description: 'daily')
}
stages {
stage("build web") {
steps {
sh "cd web && npm install && cp .env.daily .env && npm run build && rm -rf /data/www/daily.iotpack.addpoints.cn"
sh "rm -rf /data/www/daily.iotpack.addpoints.cn && mkdir /data/www/daily.iotpack.addpoints.cn && mkdir /data/www/daily.iotpack.addpoints.cn/dist"
sh "cp -rf web/dist /data/www/daily.iotpack.addpoints.cn/dist"
sh "cp -rf daily.nginx.conf web/dist /data/www/daily.iotpack.addpoints.cn/"
}
}
stage("build api") {
steps {
sh "/root/.sdkman/candidates/maven/3.6.3/bin/mvn clean package -Dmaven.test.skip=true"
sh "mkdir /data/www/daily.iotpack.addpoints.cn/bin"
sh "cp api/target/iotpack.jar /data/www/daily.iotpack.addpoints.cn/bin"
}
}
stage("deploy") {
steps {
sh "cp -rf supervisord.conf /data/www/daily.iotpack.addpoints.cn/"
sh "/usr/local/openresty/nginx/sbin/nginx -s reload"
sh "/usr/bin/supervisorctl -c /etc/supervisord.conf reload"
}
}
stage("doc") {
steps {
sh "mkdir /data/www/daily.iotpack.addpoints.cn/doc"
sh "cp -rf doc/* /data/www/daily.iotpack.addpoints.cn/doc"
}
}
}
}