-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
37 lines (33 loc) · 988 Bytes
/
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
#!groovy
import groovy.transform.Field
@Field String email_to = '[email protected]'
@Field String email_from = '[email protected]'
@Field String email_reply_to = '[email protected]'
pipeline {
agent any
stages {
stage('Build') {
steps {
echo "Building goes..."
sh 'set +x; go vet ./... && for package in `find . -type d -print` ; do ls $package/*.go > /dev/null 2>&1 && { echo "Working on" $package ; { ls $package/*_test.go > /dev/null 2>&1 && { go test -v $package || exit; } } ; { go build -v -buildmode=archive $package || exit; } } || echo "Skipping" $package;done'
}
}
}
post {
success {
mail body: "GOES build ok: ${env.BUILD_URL}",
from: email_from,
replyTo: email_reply_to,
subject: 'GOES build ok',
to: email_to
}
failure {
cleanWs()
mail body: "GOES build error: ${env.BUILD_URL}",
from: email_from,
replyTo: email_reply_to,
subject: 'GOES BUILD FAILED',
to: email_to
}
}
}