-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfilek8s
60 lines (55 loc) · 1.57 KB
/
Jenkinsfilek8s
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
// Jenkinsfile v2.0.0
pipeline {
agent {
kubernetes {
defaultContainer 'xc8-mplabx'
yamlFile '.citd/cloudprovider.yml'
}
}
parameters {
string( name: 'NOTIFICATION_EMAIL',
defaultValue: 'PICAVR_Examples_GateKeepers@microchip.com',
description: "Email to send build failure and fixed notifications.")
}
environment {
GITHUB_OWNER = 'microchip-pic-avr-examples'
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/pic18f16q41-weather-station-cnano-mplab-mcc'
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/pic18f16q41-weather-station-cnano-mplab-mcc.git'
SEMVER_REGEX = '^(0|[1-9]\\d*)+\\.(0|[1-9]\\d*)+\\.(0|[1-9]\\d*)+$'
ARTIFACTORY_SERVER = 'https://artifacts.microchip.com:7999/artifactory'
}
options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('setup') {
steps {
script {
execute("git clone https://bitbucket.microchip.com/scm/citd/mpae-buildpipeline-groovy-scripts.git")
def buildPipeline = load ('mpae-buildpipeline-groovy-scripts/xc8mplabx-buildpipeline.groovy')
buildPipeline.runStages()
}
}
}
}
post {
failure {
script {
sendPipelineFailureEmail()
}
}
}
}
def execute(String cmd) {
if(isUnix()) {
sh cmd
} else {
bat cmd
}
}
def sendPipelineFailureEmail() {
mail to: "${env.EMAILLIST},${params.NOTIFICATION_EMAIL}",
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Pipeline failure. ${env.BUILD_URL}"
}