Skip to content

Commit a275663

Browse files
committed
MCU8QA-162 added new CICD files
1 parent 2eb684a commit a275663

File tree

4 files changed

+138
-12
lines changed

4 files changed

+138
-12
lines changed

.gitignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
/*/dist/
2-
/*/build/
3-
/*/nbproject/private/
4-
/*/nbproject/*.properties
5-
/*/nbproject/*.mk
6-
/*/nbproject/*.bash
1+
# Untracked files in MPLABX projects
2+
/**/build/*
3+
/**/nbproject/*
4+
!/**/nbproject/*.xml
5+
/**/[Ff]ree/production/*
6+
/**/[Pp]ro/production/*
7+
8+
# Uncomment these to include hex/elf files
9+
#!/**/[Ff]ree/production/*.hex
10+
#!/**/[Ff]ree/production/*.elf
11+
#!/**/[Pp]ro/production/*.hex
12+
#!/**/[Pp]ro/production/*.elf

.main-meta/main.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"metaDataVersion": "1.0.0",
3+
"category": "com.microchip.ide.project",
4+
"content": {
5+
"metaDataVersion": "1.1.0",
6+
"name": "com.microchip.mcu8.mplabx.project.",
7+
"version": " ",
8+
"displayName": " ",
9+
"projectName": "",
10+
"shortDescription": "",
11+
"ide": {
12+
"name": "",
13+
"semverRange": ""
14+
},
15+
"compiler": [
16+
{
17+
"name": "",
18+
"semverRange": ""
19+
}
20+
],
21+
"dfp": {
22+
"name": "",
23+
"semverRange": ""
24+
},
25+
"configurator": {
26+
"name": "",
27+
"semverRange": ""
28+
},
29+
"device": {
30+
"metaDataVersion": "1.0.0",
31+
"category": "com.microchip.portal.contentRef",
32+
"content": {
33+
"metaDataVersion": "1.0.0",
34+
"category": "com.microchip.device",
35+
"name": "",
36+
"versionRange": "*"
37+
}
38+
},
39+
"author": "",
40+
"subcategories": [
41+
"",
42+
[
43+
"Peripherals", ""
44+
],
45+
[
46+
"Peripherals", ""
47+
]
48+
],
49+
"peripherals": [
50+
"",""
51+
],
52+
"keywords": [
53+
"",
54+
""
55+
],
56+
"additionalData": {
57+
"longDescription": {
58+
"metaDataVersion": "1.0.0",
59+
"category": "com.microchip.portal.fileRef",
60+
"content": {
61+
"metaDataVersion": "1.0.0",
62+
"fileName": "./README.md",
63+
"mimeType": "text/markdown"
64+
}
65+
}
66+
}
67+
}
68+
}

Jenkinsfilek8s

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Jenkinsfilek8s v1.2.0
2+
13
pipeline {
24
agent {
35
kubernetes {
@@ -13,7 +15,8 @@ pipeline {
1315
description: "Email to send build failure and fixed notifications.")
1416
}
1517

16-
environment {
18+
environment {
19+
GITHUB_OWNER = 'microchip-pic-avr-examples'
1720
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/atmega4809-noise-countermeasures-adc-mplab.git'
1821
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/atmega4809-noise-countermeasures-adc-mplab.git'
1922
DEPLOY_TOOL_URL = 'https://bitbucket.microchip.com/scm/citd/tool-github-deploy.git'
@@ -23,7 +26,7 @@ pipeline {
2326

2427
options {
2528
timestamps()
26-
timeout(time: 20, unit: 'MINUTES')
29+
timeout(time: 30, unit: 'MINUTES')
2730
}
2831

2932
stages {
@@ -33,6 +36,17 @@ pipeline {
3336
}
3437
}
3538

39+
stage('metadata') {
40+
steps {
41+
script {
42+
execute("pip install jsonschema")
43+
execute("git clone https://bitbucket.microchip.com/scm/citd/metadata-schema.git")
44+
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-metadata-validator.git")
45+
execute("cd tool-metadata-validator && python metadata-validator.py -data '../.main-meta/main.json' -schema '../metadata-schema/main-schema.json'")
46+
}
47+
}
48+
}
49+
3650
stage('Pre-build') {
3751
steps {
3852
script {
@@ -56,7 +70,7 @@ pipeline {
5670
}
5771
}
5872

59-
stage('Deploy') {
73+
stage('GitHub-Deploy') {
6074
when {
6175
not {
6276
changeRequest()
@@ -76,8 +90,40 @@ pipeline {
7690
sendSuccessfulGithubDeploymentEmail()
7791
}
7892
}
79-
}
93+
}
94+
95+
stage('Portal-Deploy') {
96+
when {
97+
not {
98+
changeRequest()
99+
}
100+
tag ''
101+
}
102+
steps {
103+
script {
104+
def metadata = readJSON file:".main-meta/main.json"
105+
def version = metadata.content.version
106+
def project = metadata.content.projectName
107+
108+
if(version == env.TAG_NAME) {
109+
def cmdArgs = "'{\"repoOwnerName\":\"$env.GITHUB_OWNER\",\"repoName\":\"$project\",\"tagName\":\"$version\"}'"
110+
cmdArgs = cmdArgs.replaceAll("\"","\\\\\"")
111+
112+
execute("git clone https://bitbucket.microchip.com/scm/portal/bundles.git")
113+
execute("cd bundles && chmod 755 ./portal-client-cli-linux")
114+
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-portal-client-launcher.git")
115+
execute("cd tool-portal-client-launcher && node portalLauncher.js -app=../bundles/portal-client-cli-linux -cmd=\"uploadGitHub ${cmdArgs}\"")
116+
sendSuccessfulPortalDeploymentEmail()
117+
} else {
118+
echo "Tag name is not equal to metadata content version."
119+
execute("exit 1")
120+
}
121+
122+
}
123+
}
124+
}
80125
}
126+
81127

82128
post {
83129
failure {
@@ -113,6 +159,12 @@ def sendPipelineFailureEmail () {
113159

114160
def sendSuccessfulGithubDeploymentEmail () {
115161
mail to: "${params.NOTIFICATION_EMAIL}",
116-
subject: "Successful Deployment: ${currentBuild.fullDisplayName}",
162+
subject: "Successful Github Deployment: ${currentBuild.fullDisplayName}",
117163
body: "The changes have been successfully deployed to GitHub. ${env.GITHUB_URL}"
164+
}
165+
166+
def sendSuccessfulPortalDeploymentEmail () {
167+
mail to: "${params.NOTIFICATION_EMAIL}",
168+
subject: "Successful Portal Deployment: ${currentBuild.fullDisplayName}",
169+
body: "The changes have been successfully deployed to Discover Portal."
118170
}

cloudprovider.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
containers:
77
- name: xc8-mplabx
8-
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc8-mplabx:2.10-5.35
8+
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc8-mplabx:latest
99
imagePullPolicy: Always
1010
command: ['cat']
1111
tty: true

0 commit comments

Comments
 (0)