forked from adafruit/Adafruit_BMP280_Library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
51 lines (49 loc) · 1.75 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
pipeline {
agent any
options {
timeout(time: 10, unit: 'MINUTES')
timestamps()
}
stages {
stage('Build') {
steps {
withCredentials([usernamePassword(credentialsId: 'b93384a9-c09d-42b6-b8f1-adb1f4e045c6', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh("""
git config --global credential.username ${GIT_USERNAME}
git config --global credential.helper "!echo password=${GIT_PASSWORD}; echo"
git config --global advice.detachedHead false
export PLATFORMIO_CORE_DIR=.
export PLATFORMIO_CACHE_DIR=.
$PLATFORMIO_FOLDER/pio upgrade
sed -i \'/default_envs/d\' platformio.ini
$PLATFORMIO_FOLDER/pio run
""")
}
}
}
}
post {
always {
echo 'Cleaning up workspace'
deleteDir() /* clean up our workspace */
}
failure {
emailext (
attachLog: true,
body: '''${SCRIPT, template="groovy-html.template"}''',
subject: "${env.JOB_NAME} FAILED - Build # ${env.BUILD_NUMBER}",
mimeType: 'text/html',
to: 'basschouten65@gmail.com'
)
}
fixed {
emailext (
to: 'basschouten65@gmail.com',
body: '''${SCRIPT, template="groovy-html.template"}''',
subject: "${env.JOB_NAME} Back to Normal - Build # ${env.BUILD_NUMBER}",
mimeType: 'text/html',
attachLog: true
)
}
}
}