-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
47 lines (42 loc) · 1 KB
/
Jenkinsfile
File metadata and controls
47 lines (42 loc) · 1 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
44
45
46
47
node("server-status") {
deleteDir();
stage("SCM") {
checkout scm;
}
//
// Usage graphs
//
dir("usage") {
stage("Generate") {
sh(
script: "npm install",
label: "NPM install packages"
);
sh(
script: "node create-graphs.js public https://data.openspaceproject.com/log/data.json",
label: "Generate page"
)
}
if (env.BRANCH_NAME == "master") {
stage("Deploy") {
def target = "/var/www/status.openspaceproject.com/html"
sh(
script: "mkdir -p ${target}",
label: "Create directory if it does not already exist"
);
sh(
script: "rm -rf ${target}/*",
label: "Remove old files"
);
sh(
script: "mv public/* ${target}",
label: "Deploy files"
);
}
}
}
if (env.BRANCH_NAME != "master") {
echo("Skipping the deployment as we are not working on the 'master' branch")
currentBuild.result = "NOT_BUILT";
}
}