-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (56 loc) · 2.03 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
// https://jenkins.io/doc/book/pipeline/jenkinsfile/
// Scripted pipeline (not declarative)
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Build & deliver') {
agent { docker 'mauriciojost/arduino-ci:platformio-3.5.3-0.2.1' }
stages {
stage('Update build refs') {
steps {
script {
def libraryjson = readJSON file: 'library.json'
def vers = libraryjson['version']
def buildId = env.BUILD_ID
currentBuild.displayName = "#$buildId - $vers"
}
}
}
stage('Pull dependencies') {
steps {
script {
sshagent(['bitbucket_key']) {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
sh 'git submodule update --init --recursive'
sh '.mavarduino/create_links'
sh 'export GIT_COMMITTER_NAME=jenkinsbot && export [email protected] && set && ./pull_dependencies -p -l'
}
}
}
}
}
stage('Test') {
steps {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
sh './launch_tests'
}
}
}
}
}
}
agent any
post {
failure {
emailext body: "<b>[JENKINS] Failure</b>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> Build URL: ${env.BUILD_URL}", from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: ${env.JOB_NAME}", to: "[email protected]", attachLog: true, compressLog: false;
}
success {
emailext body: "<b>[JENKINS] Success</b>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> Build URL: ${env.BUILD_URL}", from: '', mimeType: 'text/html', replyTo: '', subject: "SUCCESS CI: ${env.JOB_NAME}", to: "[email protected]", attachLog: false, compressLog: false;
}
always {
deleteDir()
}
}
}