forked from platinasystems/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
68 lines (62 loc) · 1.92 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
68
#!groovy
import groovy.transform.Field
@Field String email_to = '[email protected]'
@Field String email_cc = '[email protected]'
@Field String email_from = '[email protected]'
@Field String email_reply_to = '[email protected]'
pipeline {
agent any
stages {
stage('Checkout') {
steps {
echo "Running build #${env.BUILD_ID} on ${env.JENKINS_URL}"
// Change to usual go subdir.
dir('/home/jenkins/workspace/go/src/github.com/platinasystems/go') {
git url: 'https://github.com/platinasystems/go.git'
}
dir('/home/jenkins/workspace/go/src/github.com/platinasystems/fe1') {
git([
url: '[email protected]:platinasystems/fe1.git',
credentialsId: "570701f7-c819-4db2-bd31-a0da8a452b41",
branch: 'master'
])
}
dir('/home/jenkins/workspace/go/src/github.com/platinasystems/firmware-fe1a') {
git([
url: '[email protected]:platinasystems/firmware-fe1a.git',
credentialsId: "570701f7-c819-4db2-bd31-a0da8a452b41",
branch: 'master'
])
}
}
}
stage('Build') {
steps {
dir('/home/jenkins/workspace/go/src/github.com/platinasystems/go') {
echo "Building goes..."
sh 'env PATH=/usr/local/go/bin:${PATH} GOPATH=/home/jenkins/workspace/go make noplugin=yes -B all'
sh 'docker build .'
}
}
}
}
post {
success {
mail body: "GOES build ok: ${env.BUILD_URL}\n\ngoes-platina-mk1-installer is stored on platina4 at /home/jenkins/workspace/go/src/github.com/platinasystems/go/goes-platina-mk1\neg.\nscp 172.16.2.23:/home/jenkins/workspace/go/src/github.com/platinasystems/go/goes-platina-mk1 ~/path/to/somewhere/",
from: email_from,
replyTo: email_reply_to,
subject: 'GOES build ok',
cc: email_cc,
to: email_to
}
failure {
cleanWs()
mail body: "GOES build error: ${env.BUILD_URL}",
from: email_from,
replyTo: email_reply_to,
subject: 'GOES BUILD FAILED',
cc: email_cc,
to: email_to
}
}
}