forked from OBOFoundry/OBOFoundry.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (60 loc) · 1.41 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
pipeline {
agent any
// In additional to manual runs, trigger somewhere at midnight to
// give us the max time in a day to get things right.
triggers {
// Master never runs--Feb 31st.
cron('0 0 31 2 *')
// Nightly @12am.
//cron('0 0 2-31 * *')
// First of the month @12am, for "release" (also "current").
//cron('0 0 1 * *')
}
environment {
///
/// Automatic run variables.
///
// Pin dates and day to beginning of run.
START_DATE = sh (
script: 'date +%Y-%m-%d',
returnStdout: true
).trim()
START_DAY = sh (
script: 'date +%A',
returnStdout: true
).trim()
///
/// Internal run variables.
///
// The people to call when things go bad. It is a comma-space
// "separated" string.
TARGET_ADMIN_EMAILS = 'rbca.jackson@gmail.com'
}
options{
timestamps()
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
// Very first: pause for a minutes to give a chance to cancel
// and clean the workspace before use.
stage('Ready and clean') {
steps {
// Give us a minute to cancel if we want.
//sleep time: 1, unit: 'MINUTES'
cleanWs deleteDirs: true, disableDeferredWipeout: true
}
}
stage('Initialize') {
steps {
// Start preparing environment.
sh 'env > env.txt'
sh 'echo $BRANCH_NAME > branch.txt'
sh 'echo "$BRANCH_NAME"'
sh 'cat env.txt'
sh 'cat branch.txt'
sh 'echo $START_DAY > dow.txt'
sh 'echo "$START_DAY"'
}
}
}
}