-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
89 lines (81 loc) · 2.33 KB
/
Jenkinsfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
}
triggers {
cron 'H H/8 * * *'
}
stages {
stage('Installing dependencies') {
steps {
echo 'installing NPM dependencies'
sh '''
npm i
'''
echo 'installing Haxe dependencies'
sh '''
npx lix download
'''
}
}
stage('Download benchs.haxe.org') {
steps {
echo 'Copy Formatter detail pages'
sh '''
if [ ! -d "benchs.haxe.org" ]; then
git clone --depth 1 https://github.com/HaxeBenchmarks/benchs.haxe.org.git
else
cd benchs.haxe.org
git pull
fi
'''
}
}
stage('Prepare site') {
steps {
echo 'Preparing site folder'
sh '''
mkdir -p site/js
mkdir -p site/css
'''
}
}
stage('Build benchmark.css') {
steps {
echo 'Building benchmark.cs'
sh '''
npx sass css/one-shot-benchmark.scss site/css/one-shot-benchmark.css
'''
}
}
stage('Build benchmark.js') {
steps {
echo 'Building one-shot-benchmark.js'
sh '''
npx haxe buildOneShotJs.hxml
'''
}
}
stage('Build one-shot-page PHP') {
steps {
echo 'Building one-shot-page PHP'
sh '''
npx haxe build.hxml
'''
}
}
stage('Install to webserver') {
steps {
echo 'Install to webserver'
sh '''
rsync -rlu site/* $BENCHMARKS_WEBROOT/one-shot
mv $BENCHMARKS_WEBROOT/one-shot/js/one-shot-benchmark.js $BENCHMARKS_WEBROOT/js
mv $BENCHMARKS_WEBROOT/one-shot/css/one-shot-benchmark.css $BENCHMARKS_WEBROOT/css
mkdir -p $BENCHMARKS_WEBROOT/one-shot-benchmarks
'''
}
}
}
}