Skip to content

Commit 4efc45f

Browse files
committed
MPAE-2241 added CI support and readme
1 parent 2451a2a commit 4efc45f

File tree

4 files changed

+149
-0
lines changed

4 files changed

+149
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[Dd]ebug/
2+
[Rr]elease/
3+
*.atsuo
4+
.vs

Jenkinsfile

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
pipeline {
2+
agent {
3+
label 'idc-dk-i14545.microchip.com'
4+
}
5+
6+
parameters {
7+
string( name: 'NOTIFICATION_EMAIL',
8+
defaultValue: 'PICAVR_Examples_GateKeepers@microchip.com',
9+
description: "Email to send build failure, fixed and successful deployment notifications.")
10+
}
11+
12+
environment {
13+
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/avr128db48-getting-started-with-mvio.git'
14+
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/avr128db48-getting-started-with-mvio.git'
15+
DEPLOY_TOOL_URL = 'https://bitbucket.microchip.com/scm/citd/tool-github-deploy.git'
16+
DEPLOY_SCRIPT_DIR = 'tool-github-deploy'
17+
DEPLOY_SCRIPT_FILE = 'deploy-source-as-is.sh'
18+
}
19+
20+
options {
21+
timestamps()
22+
timeout(time: 20, unit: 'MINUTES')
23+
}
24+
25+
stages {
26+
stage('Checkout') {
27+
steps {
28+
checkout scm
29+
}
30+
}
31+
32+
stage('Build') {
33+
steps {
34+
script {
35+
execute("git clone https://bitbucket.microchip.com/scm/~i20936/tool-studio-c-build.git")
36+
execute("cd tool-studio-c-build && python studiobuildtool.py")
37+
38+
}
39+
}
40+
}
41+
42+
stage('Deploy') {
43+
when {
44+
not {
45+
changeRequest()
46+
}
47+
anyOf {
48+
tag ''
49+
}
50+
}
51+
steps {
52+
script {
53+
execute("git clone ${env.DEPLOY_TOOL_URL}")
54+
55+
withCredentials([usernamePassword(credentialsId: '8bit-examples.github.com', usernameVariable: 'USER_NAME', passwordVariable:'USER_PASS' )]) {
56+
execute("cd ${env.DEPLOY_SCRIPT_DIR} && sh ${env.DEPLOY_SCRIPT_FILE} ${env.BITBUCKET_URL} ${env.GITHUB_URL} ${USER_NAME} ${USER_PASS} '--tag ${env.TAG_NAME}'")
57+
}
58+
59+
sendSuccessfulGithubDeploymentEmail()
60+
}
61+
}
62+
}
63+
}
64+
65+
post {
66+
failure {
67+
script {
68+
sendPipelineFailureEmail()
69+
}
70+
}
71+
always {
72+
archiveArtifacts artifacts: "tool-studio-c-build/output/**", allowEmptyArchive: true, fingerprint: true
73+
script{
74+
cleanWs()
75+
}
76+
}
77+
}
78+
}
79+
80+
def execute(String cmd) {
81+
if(isUnix()) {
82+
sh cmd
83+
} else {
84+
bat cmd
85+
}
86+
}
87+
88+
def sendPipelineFailureEmail () {
89+
if (!"${env.CHANGE_AUTHOR_EMAIL}".equalsIgnoreCase("null")) {
90+
mail to: "${env.CHANGE_AUTHOR_EMAIL}, ${params.NOTIFICATION_EMAIL}",
91+
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
92+
body: "Pipeline failure. ${env.BUILD_URL}"
93+
} else {
94+
mail to: "${params.NOTIFICATION_EMAIL}",
95+
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
96+
body: "Pipeline failure. ${env.BUILD_URL}"
97+
}
98+
}
99+
100+
def sendSuccessfulGithubDeploymentEmail () {
101+
mail to: "${params.NOTIFICATION_EMAIL}",
102+
subject: "Successful Deployment: ${currentBuild.fullDisplayName}",
103+
body: "The changes have been successfully deployed to GitHub. ${env.GITHUB_URL}"
104+
}

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- Please do not change this html logo with link -->
2+
<a href="https://www.microchip.com" rel="nofollow"><img src="images/Microchip.png" alt="MCHP" width="300"/></a>
3+
4+
# Update the title for avr128db48-getting-started-with-mvio here
5+
6+
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
7+
8+
## Related Documentation
9+
10+
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
11+
In addition a link to the device family landing page and relevant peripheral pages as well:
12+
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
13+
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
14+
15+
## Software Used
16+
17+
<!-- All software used in this example must be listed here. Use unbreakable links!
18+
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
19+
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
20+
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
21+
- MPLAB® Code Configurator (MCC) Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
22+
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
23+
24+
## Hardware Used
25+
26+
<!-- All hardware used in this example must be listed here. Use unbreakable links!
27+
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
28+
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
29+
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
30+
31+
## Setup
32+
33+
<!-- Explain how to connect hardware and set up software. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
34+
35+
## Operation
36+
37+
<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
38+
39+
## Summary
40+
41+
<!-- Summarize what the example has shown -->

images/microchip.png

37.2 KB
Loading

0 commit comments

Comments
 (0)