Skip to content

Commit 126d2fa

Browse files
committed
Initial commit of deployment files without project or source files
0 parents  commit 126d2fa

19 files changed

+659
-0
lines changed

.citd/Jenkinsfilek8s

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
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 'dpsk4-power-live-update'
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+
GITHUB_PRODUCTION_ORGANIZATION = "microchip-pic-avr-examples"
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/dpsk4-power-live-update.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,mchp-private,.mchp-private,sandbox,.sandbox,test,.test'
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,main"
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+
stage('Doxygen files generation') {
119+
when {
120+
anyOf {
121+
allOf {
122+
not { changeRequest() }
123+
}
124+
}
125+
}
126+
steps {
127+
container('buildtools') {
128+
script {
129+
doxygen()
130+
}
131+
}
132+
}
133+
}
134+
135+
// GitHub repo creation
136+
stage('GitHub Repo Creation') {
137+
when {
138+
anyOf {
139+
allOf {
140+
not { changeRequest() }
141+
anyOf {branch 'master'; branch 'main'; branch 'test_deploy';}
142+
}
143+
}
144+
}
145+
146+
steps {
147+
script {
148+
githubRepoCreate(
149+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
150+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
151+
)
152+
}
153+
}
154+
}
155+
156+
// Deploying the code to GitHub
157+
stage('GitHub Deploy Source') {
158+
when {
159+
anyOf {
160+
allOf {
161+
not { changeRequest() }
162+
anyOf {branch 'master'; branch 'main'; branch 'test_deploy';}
163+
}
164+
}
165+
}
166+
167+
steps {
168+
script {
169+
githubDeploySource(
170+
bitbucketUrl: "${env.BITBUCKET_SOURCE_URL}",
171+
deployBranchList: "${env.DEPLOY_BRANCH_LIST}",
172+
deployExcludeFileList: "${env.DEPLOY_EXCLUDE_FOLDER_FILE_LIST}",
173+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
174+
)
175+
}
176+
}
177+
}
178+
179+
// Creating GitHub release
180+
stage('GitHub release') {
181+
when {
182+
anyOf {
183+
allOf {
184+
not { changeRequest() }
185+
anyOf {branch 'master'; branch 'main'; branch 'test_deploy';}
186+
}
187+
}
188+
}
189+
190+
steps {
191+
script {
192+
githubReleaseCreate(
193+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
194+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
195+
)
196+
}
197+
}
198+
}
199+
200+
// Creating GitHub Page
201+
stage('GitHub Page Create') {
202+
when {
203+
anyOf {
204+
allOf {
205+
not { changeRequest() }
206+
anyOf {branch 'master'; branch 'main';}
207+
}
208+
}
209+
}
210+
211+
steps {
212+
script {
213+
githubPageCreate(
214+
githubPage: "${env.GITHUB_PAGES}",
215+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
216+
)
217+
}
218+
}
219+
}
220+
221+
//Deploying the Github content to portal
222+
stage('Portal-Deploy') {
223+
when {
224+
allOf {
225+
not { changeRequest() }
226+
anyOf {branch 'master'; branch 'main';}
227+
}
228+
}
229+
steps {
230+
script {
231+
portalDeploy(
232+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
233+
unapprovedKeywordsOverrideList: "${UNAPPROVED_KEYWORDS_OVERRIDE_LIST}"
234+
)
235+
}
236+
}
237+
}
238+
}
239+
240+
post {
241+
success{
242+
script {
243+
sendMail(
244+
mailId: "${env.NOTIFICATION_EMAIL}",
245+
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
246+
body: "Something is right with ${env.BUILD_URL}"
247+
)
248+
}
249+
}
250+
failure {
251+
script {
252+
sendMail(
253+
mailId: "${env.NOTIFICATION_EMAIL}",
254+
subject: "Failure Pipeline: ${currentBuild.fullDisplayName}",
255+
body: "Something is right with ${env.BUILD_URL}"
256+
)
257+
}
258+
}
259+
}
260+
}

.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: 250Mi
28+
limits:
29+
cpu: 1
30+
memory: 500Mi

.gitignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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 and file types
14+
#docs/
15+
!.mchp_private/docs/
16+
!.mchp_private/docs/
17+
!.mchp-private/docs/
18+
!.mchp-private/docs/
19+
.mchp_private/doxygen/doxylog.txt
20+
.mchp_private/doxygen/doxymsg.txt
21+
.mchp-private/doxygen/doxylog.txt
22+
.mchp-private/doxygen/doxymsg.txt
23+
mchp_private/doxygen/doxylog.txt
24+
mchp_private/doxygen/doxymsg.txt
25+
mchp-private/doxygen/doxylog.txt
26+
mchp-private/doxygen/doxymsg.txt
27+
28+
# Excluding archive and backup directories
29+
.archive/
30+
.backup/
31+
32+
# Excluding documentation input directories
33+
#_dox/
34+
#_dox/images/
35+
36+
# Exclude firmware documentation output directory
37+
docs/
38+
39+
# Excluding test output directories
40+
test/
41+
.test/
42+
43+
# Excluding SiMetrix/Simplis temporary simulation directories
44+
SIMPLIS_Data/
45+
TMP/
46+
47+
# Excluding any executables
48+
*.exe
49+
50+
#Excluding Files/Folders Auto-Generated by Test Harness
51+
.generated_files/
52+
node_modules/
53+
54+
# Excluding Netbeans specific build directories and file types
55+
~*.*
56+
.generated_files/
57+
queuelogs/
58+
nbproject/build/
59+
nbproject/dist/
60+
nbproject/private/
61+
nbproject/disassembly/
62+
build/
63+
debug/
64+
dist/
65+
private/
66+
disassembly/
67+
*.zip
68+
!code-templates.zip
69+
*.mk
70+
*.bash
71+
*.dump
72+
Makefile-genesis.properties
73+
74+
# Excluding MPLAB X® Trace files
75+
*.log
76+
*.inx
77+
78+
# VisualStudio Code specific
79+
buildLog/
80+
81+
# KDE specific
82+
.directory
83+
84+
# Misc
85+
.svn
86+
*.bak
87+
88+
89+

0 commit comments

Comments
 (0)