-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile20211025.bak
72 lines (69 loc) · 1.61 KB
/
Jenkinsfile20211025.bak
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
/* -*- mode: groovy -*- */
pipeline {
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '50', daysToKeepStr: '60', numToKeepStr: '50')
disableConcurrentBuilds()
disableResume()
durabilityHint 'PERFORMANCE_OPTIMIZED'
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
agent none
stages {
stage('multiple env') {
parallel {
stage('ci env') {
when {
beforeAgent true
anyOf {
branch 'dev'
branch 'jenkins-pipeline'
}
}
agent {label 'bounty-backend-test-machine'}
steps {
nodejs(nodeJSInstallationName: 'nodejs15') {
script {
sh (label: 'build', script: """
yarn && yarn build
"""
)
}
}
script {
sh (label: 'move to nginx www', script: """
sudo rm -rf /www/sirius/ || true
sudo cp -r build /www/sirius
""")
}
}
}
stage('prod env') {
when {
beforeAgent true
allOf {
branch 'master'
}
}
agent {label 'confluxscan.io'}
steps {
nodejs(nodeJSInstallationName: 'nodejs15') {
script {
sh (label: 'build', script: """
yarn && yarn build
"""
)
}
}
script {
sh (label: 'move builds', script: """
sudo rm -rf /www/sirius/ || true
sudo cp -r build /www/sirius
""")
}
}
}
}
}
}
}