Skip to content

Commit 042b3c0

Browse files
committed
Pull request #4: Develop
Merge in MCU16CE/matlab-mchv3-pfc from develop to master * commit '0dcee21647e9c50ffce1b0df8038d260441e9aed': Model subsystems are created. Removed the intermediate steps and comments of compensator coefficient calculations. Readme is updated. Created subsystem in the model Readme is updated Jenkinsfile is updated to avoid build error during pull request. main.json,jenkins and changelog files updated according to MATLAB projects. Model files are added. Initial commit
2 parents 03c23c6 + 0dcee21 commit 042b3c0

21 files changed

+881
-9
lines changed

.citd/Jenkinsfilek8s

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
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 'matlab-mchv3-pfc-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-solutions"
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/matlab-mchv3-pfc.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+
options {
58+
timestamps()
59+
timeout(time: 30, unit: 'MINUTES')
60+
}
61+
62+
stages {
63+
stage('Checkout') {
64+
steps {
65+
checkout scm
66+
}
67+
}
68+
69+
stage('project config update') {
70+
steps {
71+
script {
72+
mplabxProjectConfigUpdate(
73+
sourceFilePath: "${env.MPLABX_PROJECT_SOURCE}"
74+
)
75+
}
76+
}
77+
}
78+
79+
stage('Build') {
80+
steps {
81+
script {
82+
sh("npm install -g xml2js")
83+
sh("npm link xml2js")
84+
mplabxProjectBuild(
85+
sourceFilePath: "${env.MPLABX_PROJECT_SOURCE}"
86+
)
87+
}
88+
}
89+
}
90+
91+
92+
//MisraCheck code analysis
93+
stage('MISRA Check') {
94+
steps {
95+
script {
96+
misraCheck(
97+
sourceProjectPath: "${env.MPLABX_PROJECT_SOURCE}"
98+
)
99+
}
100+
}
101+
}
102+
103+
// Validate main.json file
104+
stage('Validate main.json') {
105+
steps {
106+
script {
107+
validateMetaData(
108+
unapprovedKeywordsOverrideList: "${UNAPPROVED_KEYWORDS_OVERRIDE_LIST}"
109+
)
110+
}
111+
}
112+
}
113+
114+
stage('Doxygen files generation') {
115+
when {
116+
anyOf {
117+
allOf {
118+
not { changeRequest() }
119+
}
120+
}
121+
}
122+
steps {
123+
container('buildtools') {
124+
script {
125+
doxygen()
126+
}
127+
}
128+
}
129+
}
130+
131+
// GitHub repo creation
132+
stage('GitHub Repo Creation') {
133+
when {
134+
anyOf {
135+
allOf {
136+
not { changeRequest() }
137+
anyOf {branch 'master'; branch 'test_deploy';}
138+
}
139+
}
140+
}
141+
142+
steps {
143+
script {
144+
githubRepoCreate(
145+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
146+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
147+
)
148+
}
149+
}
150+
}
151+
152+
// Deploying the code to GitHub
153+
stage('GitHub Deploy Source') {
154+
when {
155+
anyOf {
156+
allOf {
157+
not { changeRequest() }
158+
anyOf {branch 'master'; branch 'test_deploy';}
159+
}
160+
}
161+
}
162+
163+
steps {
164+
script {
165+
githubDeploySource(
166+
bitbucketUrl: "${env.BITBUCKET_SOURCE_URL}",
167+
deployBranchList: "${env.DEPLOY_BRANCH_LIST}",
168+
deployExcludeFileList: "${env.DEPLOY_EXCLUDE_FOLDER_FILE_LIST}",
169+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
170+
)
171+
}
172+
}
173+
}
174+
175+
// Creating GitHub release
176+
stage('GitHub release') {
177+
when {
178+
anyOf {
179+
allOf {
180+
not { changeRequest() }
181+
anyOf {branch 'master'; branch 'test_deploy';}
182+
}
183+
}
184+
}
185+
186+
steps {
187+
script {
188+
githubReleaseCreate(
189+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
190+
deployBranchList: "${DEPLOY_BRANCH_LIST}"
191+
)
192+
}
193+
}
194+
}
195+
196+
// Creating GitHub Page
197+
stage('GitHub Page Create') {
198+
when {
199+
anyOf {
200+
allOf {
201+
not { changeRequest() }
202+
anyOf {branch 'master';}
203+
}
204+
}
205+
}
206+
207+
steps {
208+
script {
209+
githubPageCreate(
210+
githubPage: "${env.GITHUB_PAGES}",
211+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}"
212+
)
213+
}
214+
}
215+
}
216+
217+
//Deploying the Github content to portal
218+
stage('Portal-Deploy') {
219+
when {
220+
allOf {
221+
not { changeRequest() }
222+
anyOf {branch 'master';}
223+
}
224+
}
225+
steps {
226+
script {
227+
portalDeploy(
228+
githubOrgName: "${env.GITHUB_PRODUCTION_ORGANIZATION}",
229+
unapprovedKeywordsOverrideList: "${UNAPPROVED_KEYWORDS_OVERRIDE_LIST}"
230+
)
231+
}
232+
}
233+
}
234+
}
235+
236+
post {
237+
success{
238+
script {
239+
sendMail(
240+
mailId: "${env.NOTIFICATION_EMAIL}",
241+
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
242+
body: "Something is right with ${env.BUILD_URL}"
243+
)
244+
}
245+
}
246+
failure {
247+
script {
248+
sendMail(
249+
mailId: "${env.NOTIFICATION_EMAIL}",
250+
subject: "Failure Pipeline: ${currentBuild.fullDisplayName}",
251+
body: "Something is right with ${env.BUILD_URL}"
252+
)
253+
}
254+
}
255+
}
256+
}

.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

0 commit comments

Comments
 (0)