-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (52 loc) · 1.67 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
pipeline {
agent any
// this section configures Jenkins options
options {
// only keep 10 logs for no more than 10 days
buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '10'))
// cause the build to time out if it runs for more than 12 hours
timeout(time: 12, unit: 'HOURS')
// add timestamps to the log
timestamps()
}
// this section configures triggers
triggers {
// create a cron trigger that will run the job every day at midnight
// note that the time is based on the time zone used by the server
// where Jenkins is running, not the user's time zone
cron '@midnight'
}
// the pipeline section we all know and love: stages! :D
stages {
stage('Requirements') {
steps {
echo 'Installing requirements...'
}
}
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Report') {
steps {
echo 'Reporting....'
}
}
}
// the post section is a special collection of stages
// that are run after all other stages have completed
post {
// the always stage will always be run
always {
// the always stage can contain build steps like other stages
// a "steps{...}" section is not needed.
echo "This step will run after all other steps have finished. It will always run, even in the status of the build is not SUCCESS"
}
}
}