-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
50 lines (50 loc) · 1.48 KB
/
Jenkinsfile
File metadata and controls
50 lines (50 loc) · 1.48 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
48
49
50
pipeline {
triggers { pollSCM '@monthly' }
agent none
stages {
stage('Global scripts') {
when { branch 'main' }
agent { label 'minecraft' }
steps {
sh 'install -t /usr/local/bin global/*'
}
}
stage('Server1 scripts') {
when { branch 'main' }
agent { label 'server1' }
steps {
sh 'install -D -t ~/bin server/*'
sh 'if [ -d server1 ]; then install -D -t ~ server1/*; fi'
sh 'if [ -f crontab/server1 ]; then crontab crontab/server1; fi'
}
}
stage('Server2 scripts') {
when { branch 'main' }
agent { label 'server2' }
steps {
sh 'install -D -t ~/bin server/*'
sh 'if [ -d server2 ]; then install -D -t ~ server2/*; fi'
sh 'if [ -f crontab/server2 ]; then crontab crontab/server2; fi'
}
}
stage('Server3 scripts') {
when { branch 'main' }
agent { label 'server3' }
steps {
sh 'install -D -t ~/bin server/*'
sh 'if [ -d server3 ]; then install -D -t ~ server3/*; fi'
sh 'if [ -f crontab/server3 ]; then crontab crontab/server3; fi'
}
}
stage('Server4 scripts') {
when { branch 'main' }
agent { label 'server4' }
steps {
sh 'install -D -t ~/bin server/*'
sh 'if [ -d server4 ]; then install -D -t ~ server4/*; fi'
sh 'if [ -f crontab/server4 ]; then crontab crontab/server4; fi'
}
}
}
post { always { buildReport 'console', 'Scripts updated' } }
}