Skip to content

Commit c3ea429

Browse files
committed
Initial commit
1 parent f9ce5cd commit c3ea429

File tree

9 files changed

+423
-1
lines changed

9 files changed

+423
-1
lines changed

.citd/Jenkinsfilek8s

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
/*
2+
Jenkins Shared Library:
3+
----------------------
4+
shared-library-mcu16ce - https://bitbucket.microchip.com/scm/citd/shared-library-mcu16ce.git
5+
shared-library-common - https://bitbucket.microchip.com/scm/citd/shared-library-common.git
6+
*/
7+
@Library(['shared-library-mcu16ce@master', 'shared-library-common@master']) _
8+
9+
pipeline {
10+
agent {
11+
kubernetes {
12+
inheritFrom 'dspic33-dsc-bootloader-code-examples-github-deployment'
13+
defaultContainer 'xc16-mplabx-sonar-fmpp-python'
14+
yamlFile '.citd/cloudprovider.yml'
15+
}
16+
}
17+
18+
environment {
19+
/*
20+
Common Information
21+
*/
22+
NOTIFICATION_EMAIL = '1f1319de.microchip.com@amer.teams.ms'
23+
// GitHub production organization name
24+
GITHUB_PRODUCTION_ORGANIZATION = "microchip-pic-avr-examples"
25+
26+
/*
27+
GitHub Deploy Stage Information
28+
*/
29+
//This is the BitBucket source repo URL to be deployed
30+
BITBUCKET_SOURCE_URL = 'https://bitbucket.microchip.com/scm/mcu16ce/dspic33-dsc-bootloader-code-examples.git'
31+
//Files or folders to be excluded from deployment, if multiple files or folders use comma separator
32+
DEPLOY_EXCLUDE_FOLDER_FILE_LIST = 'mchp_private,.mchp_private,sandbox,.sandbox'
33+
//Branch(s) to be deployed, if multiple branches use comma separator. DEPLOY_BRANCH_LIST is the target branch of the PR.
34+
DEPLOY_BRANCH_LIST = "master"
35+
/*When using the main.json schema version 1.3.0 or higher, the PORTAL will first reject registration attempt when an unapproved keyword is found, but can be forced to accept.
36+
This argument is used to provide the list of unapproved keywords (also listed in main.json) which the deployment script will force the PORTAL to accept.*/
37+
UNAPPROVED_KEYWORDS_OVERRIDE_LIST="NONE"
38+
39+
/*
40+
GitHub Page Stage Information
41+
List of GitHub Page Options:
42+
----------------------------
43+
1. GITHUB_PAGES_NONE ( Branch: None, index file path: None )
44+
2. GITHUB_PAGES_MASTER_ROOT ( Branch: Master, index file path: /root )
45+
3. GITHUB_PAGES_MASTER_DOCS ( Branch: Master, index file path: /Docs )
46+
4. GITHUB_PAGES_DEVELOP_ROOT ( Branch: Develop, index file path: /root )
47+
5. GITHUB_PAGES_DEVELOP_DOCS ( Branch: Develop, index file path: /Docs )
48+
*/
49+
GITHUB_PAGES = 'GITHUB_PAGES_NONE'
50+
51+
/*
52+
Project Build Stage Information
53+
*/
54+
MPLABX_PROJECT_SOURCE = "../"
55+
}
56+
57+
triggers {
58+
cron(env.BRANCH_NAME == 'develop' ? 'H H 1 * *': '')
59+
}
60+
61+
options {
62+
timestamps()
63+
timeout(time: 30, unit: 'MINUTES')
64+
}
65+
66+
stages {
67+
stage('Checkout') {
68+
steps {
69+
checkout scm
70+
}
71+
}
72+
73+
stage('project config update') {
74+
steps {
75+
script {
76+
mplabxProjectConfigUpdate(
77+
sourceFilePath: "${env.MPLABX_PROJECT_SOURCE}",
78+
dfpUpdate: false,
79+
dfpInternal: false
80+
)
81+
}
82+
}
83+
}
84+
85+
stage('Build') {
86+
steps {
87+
script {
88+
mplabxProjectBuild(
89+
sourceFilePath: "${env.MPLABX_PROJECT_SOURCE}"
90+
)
91+
}
92+
}
93+
}
94+
95+
96+
//MisraCheck code analysis
97+
stage('MISRA Check') {
98+
steps {
99+
script {
100+
misraCheck(
101+
sourceProjectPath: "${env.MPLABX_PROJECT_SOURCE}"
102+
)
103+
}
104+
}
105+
}
106+
107+
// Validate main.json file
108+
stage('Validate main.json') {
109+
steps {
110+
script {
111+
validateMetaData(
112+
unapprovedKeywordsOverrideList: "${UNAPPROVED_KEYWORDS_OVERRIDE_LIST}"
113+
)
114+
}
115+
}
116+
}
117+
118+
// Creating tag in Bitbucket repo
119+
stage('Bitbucket Tag Creation') {
120+
when {
121+
anyOf {
122+
allOf {
123+
not { changeRequest() }
124+
anyOf {branch 'master';}
125+
}
126+
}
127+
}
128+
129+
steps {
130+
script {
131+
bitbucketTagCreation()
132+
}
133+
}
134+
}
135+
136+
stage('Doxygen files generation') {
137+
when {
138+
anyOf {
139+
allOf {
140+
not { changeRequest() }
141+
}
142+
}
143+
}
144+
steps {
145+
container('buildtools') {
146+
script {
147+
doxygen()
148+
}
149+
}
150+
}
151+
}
152+
153+
// GitHub repo creation
154+
stage('GitHub Repo Creation') {
155+
when {
156+
anyOf {
157+
allOf {
158+
not { changeRequest() }
159+
anyOf {branch 'master'; branch 'test_deploy';}
160+
}
161+
}
162+
}
163+
164+
steps {
165+
script {
166+
githubRepoCreate(
167+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
168+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
169+
)
170+
}
171+
}
172+
}
173+
174+
// Deploying the code to GitHub
175+
stage('GitHub Deploy Source') {
176+
when {
177+
anyOf {
178+
allOf {
179+
not { changeRequest() }
180+
anyOf {branch 'master'; branch 'test_deploy';}
181+
}
182+
}
183+
}
184+
185+
steps {
186+
script {
187+
githubDeploySource(
188+
bitbucketUrl: "${env.BITBUCKET_SOURCE_URL}",
189+
deployBranchList: "${env.DEPLOY_BRANCH_LIST}",
190+
deployExcludeFileList: "${env.DEPLOY_EXCLUDE_FOLDER_FILE_LIST}",
191+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
192+
)
193+
}
194+
}
195+
}
196+
197+
// Creating GitHub release
198+
stage('GitHub release') {
199+
when {
200+
anyOf {
201+
allOf {
202+
not { changeRequest() }
203+
anyOf {branch 'master'; branch 'test_deploy';}
204+
}
205+
}
206+
}
207+
208+
steps {
209+
script {
210+
githubReleaseCreate(
211+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
212+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
213+
)
214+
}
215+
}
216+
}
217+
218+
// Creating GitHub Page
219+
stage('GitHub Page Create') {
220+
when {
221+
anyOf {
222+
allOf {
223+
not { changeRequest() }
224+
anyOf {branch 'master';}
225+
}
226+
}
227+
}
228+
229+
steps {
230+
script {
231+
githubPageCreate(
232+
githubPage: "${env.GITHUB_PAGES}",
233+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
234+
)
235+
}
236+
}
237+
}
238+
239+
//Deploying the Github content to portal
240+
stage('Portal-Deploy') {
241+
when {
242+
allOf {
243+
not { changeRequest() }
244+
anyOf {branch 'master';}
245+
}
246+
}
247+
steps {
248+
script {
249+
portalDeploy(
250+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
251+
unapprovedKeywordsOverrideList: "${UNAPPROVED_KEYWORDS_OVERRIDE_LIST}"
252+
)
253+
}
254+
}
255+
}
256+
}
257+
258+
post {
259+
success{
260+
script {
261+
sendMail(
262+
mailId: "${env.NOTIFICATION_EMAIL}",
263+
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
264+
body: "Something is right with ${env.BUILD_URL}"
265+
)
266+
}
267+
}
268+
failure {
269+
script {
270+
sendMail(
271+
mailId: "${env.NOTIFICATION_EMAIL}",
272+
subject: "Failure Pipeline: ${currentBuild.fullDisplayName}",
273+
body: "Something is right with ${env.BUILD_URL}"
274+
)
275+
}
276+
}
277+
}
278+
}

.citd/cloudprovider.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: xc16-mplabx-sonar-fmpp-python
5+
spec:
6+
containers:
7+
- name: xc16-mplabx-sonar-fmpp-python
8+
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc16-mplabx-sonar-fmpp-python-yarn-node:latest
9+
imagePullPolicy: Always
10+
command: ['cat']
11+
tty: true
12+
resources:
13+
requests:
14+
cpu: 500m
15+
memory: 1500Mi
16+
limits:
17+
cpu: 1
18+
memory: 2Gi
19+
- name: buildtools
20+
image: artifacts.microchip.com:7999/microchip/buildtools/doxygen:1.8.15-r0
21+
imagePullPolicy: Always
22+
command: ['cat']
23+
tty: true
24+
resources:
25+
requests:
26+
cpu: 500m
27+
memory: 750Mi
28+
limits:
29+
cpu: 1
30+
memory: 1Gi

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# .gitignore file
2+
#
3+
# Set up for Microchip/MPLAB X® development
4+
#
5+
# Default gitignore files for code examples, only removing/ignoring usual MPLAB X® clutter
6+
7+
# Excluding object files
8+
*.o
9+
*.ko
10+
*.obj
11+
*.elf
12+
13+
# Excluding documentation output directories
14+
#docs/
15+
16+
# Excluding any executables
17+
*.exe
18+
19+
#Excluding Files/Folders Auto-Generated by Test Harness
20+
.generated_files/
21+
22+
# Excluding Netbeans specific build directories and file types
23+
~*.*
24+
.generated_files/
25+
nbproject/build/
26+
nbproject/dist/
27+
nbproject/private/
28+
nbproject/disassembly/
29+
build/
30+
dist/
31+
private/
32+
disassembly/
33+
*.zip
34+
!code-templates.zip
35+
*.mk
36+
*.bash
37+
*.dump
38+
Makefile-genesis.properties
39+
40+
# Excluding MPLAB X® Trace files
41+
*.log
42+
*.inx
43+
44+
# KDE specific
45+
.directory
46+
47+
# Misc
48+
.svn
49+
*.bak
50+
*.doc
51+
*.docx
52+
53+
54+

0 commit comments

Comments
 (0)