-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
67 lines (57 loc) · 1.62 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
pipeline {
agent any
tools { nodejs 'node-v6.10.3' }
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Installing dependencies') {
steps {
sh 'yarn'
}
}
stage('Running tests') {
steps {
sh 'yarn test'
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Deploy') {
steps {
sh 'tools/cdn.sh'
}
}
}
post {
// Always runs. And it runs before any of the other post conditions.
always {
// Let's wipe out the workspace before we finish!
deleteDir()
}
success {
slackSend channel: '#crew-apollo-build',
color: 'good',
message: "The pipeline ${currentBuild.fullDisplayName} completed successfully."
}
failure {
slackSend channel: '#crew-apollo-build',
color: 'danger',
message: "The pipeline ${currentBuild.fullDisplayName} has failed."
}
}
// The options directive is for configuration that applies to the whole job.
options {
// For example, we'd like to make sure we only keep 10 builds at a time, so
// we don't fill up our storage!
buildDiscarder(logRotator(numToKeepStr:'10'))
// And we'd really like to be sure that this build doesn't hang forever, so
// let's time it out after an hour.
timeout(time: 30, unit: 'MINUTES')
}
}