MPAE-8028 added CI support and readme

master
Adith Kumar Urs 2020-11-19 22:46:04 -07:00
rodzic 7eb9ef1c4e
commit 2773a7ac86
7 zmienionych plików z 320 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,170 @@
// Jenkinsfilek8s v1.2.0
pipeline {
agent {
kubernetes {
label 'avr128da48-cnano-ws2812-mplab-mcc'
defaultContainer 'xc8-mplabx'
yamlFile '.citd/cloudprovider.yml'
}
}
parameters {
string( name: 'NOTIFICATION_EMAIL',
defaultValue: 'PICAVR_Examples_GateKeepers@microchip.com',
description: "Email to send build failure and fixed notifications.")
}
environment {
GITHUB_OWNER = 'microchip-pic-avr-examples'
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/avr128da48-cnano-ws2812-mplab-mcc.git'
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/avr128da48-cnano-ws2812-mplab-mcc.git'
DEPLOY_TOOL_URL = 'https://bitbucket.microchip.com/scm/citd/tool-github-deploy.git'
DEPLOY_SCRIPT_DIR = 'tool-github-deploy'
DEPLOY_SCRIPT_FILE = 'deploy-source-as-is.sh'
}
options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('metadata') {
steps {
script {
execute("pip install jsonschema")
execute("git clone https://bitbucket.microchip.com/scm/citd/metadata-schema.git")
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-metadata-validator.git")
execute("cd tool-metadata-validator && python metadata-validator.py -data '../.main-meta/main.json' -schema '../metadata-schema/main-schema.json'")
}
}
}
stage('Pre-build') {
steps {
script {
MPLABX_PATH= sh (script: 'update-alternatives --list MPLABX_PATH',returnStdout: true).trim()
COMPILER_PATH= sh (script: 'update-alternatives --list XC8_PATH',returnStdout: true).trim()
def pDir = "${MPLABX_PATH}/packs"
def ver = COMPILER_PATH.split('/')[4].substring(1)
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-mplabx-c-project-generator.git")
execute("cd tool-mplabx-c-project-generator && node configGenerator.js sp=../ v8=${ver} packs=${pDir}")
}
}
}
stage('Build') {
steps {
script {
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-mplabx-c-build.git")
execute("cd tool-mplabx-c-build && node buildLauncher.js sp=../ rp=./output genMK=true")
}
}
}
stage('GitHub-Deploy') {
when {
not {
changeRequest()
}
anyOf {
tag ''
}
}
steps {
script {
execute("git clone ${env.DEPLOY_TOOL_URL}")
withCredentials([usernamePassword(credentialsId: '8bit-examples.github.com', usernameVariable: 'USER_NAME', passwordVariable:'USER_PASS' )]) {
execute("cd ${env.DEPLOY_SCRIPT_DIR} && bash ${env.DEPLOY_SCRIPT_FILE} ${env.BITBUCKET_URL} ${env.GITHUB_URL} ${USER_NAME} ${USER_PASS} '--tag ${env.TAG_NAME}'")
}
sendSuccessfulGithubDeploymentEmail()
}
}
}
stage('Portal-Deploy') {
when {
not {
changeRequest()
}
tag ''
}
steps {
script {
def metadata = readJSON file:".main-meta/main.json"
def version = metadata.content.version
def project = metadata.content.projectName
if(version == env.TAG_NAME) {
def cmdArgs = "'{\"repoOwnerName\":\"$env.GITHUB_OWNER\",\"repoName\":\"$project\",\"tagName\":\"$version\"}'"
cmdArgs = cmdArgs.replaceAll("\"","\\\\\"")
execute("git clone https://bitbucket.microchip.com/scm/portal/bundles.git")
execute("cd bundles && chmod 755 ./portal-client-cli-linux")
execute("git clone https://bitbucket.microchip.com/scm/citd/tool-portal-client-launcher.git")
execute("cd tool-portal-client-launcher && node portalLauncher.js -app=../bundles/portal-client-cli-linux -cmd=\"uploadGitHub ${cmdArgs}\"")
sendSuccessfulPortalDeploymentEmail()
} else {
echo "Tag name is not equal to metadata content version."
execute("exit 1")
}
}
}
}
}
post {
failure {
script {
sendPipelineFailureEmail()
}
}
always {
archiveArtifacts artifacts: "tool-mplabx-c-build/output/**", allowEmptyArchive: true, fingerprint: true
}
}
}
def execute(String cmd) {
if(isUnix()) {
sh cmd
} else {
bat cmd
}
}
def sendPipelineFailureEmail () {
if (!"${env.CHANGE_AUTHOR_EMAIL}".equalsIgnoreCase("null")) {
mail to: "${env.CHANGE_AUTHOR_EMAIL}, ${params.NOTIFICATION_EMAIL}",
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Pipeline failure. ${env.BUILD_URL}"
} else {
mail to: "${params.NOTIFICATION_EMAIL}",
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Pipeline failure. ${env.BUILD_URL}"
}
}
def sendSuccessfulGithubDeploymentEmail () {
mail to: "${params.NOTIFICATION_EMAIL}",
subject: "Successful Github Deployment: ${currentBuild.fullDisplayName}",
body: "The changes have been successfully deployed to GitHub. ${env.GITHUB_URL}"
}
def sendSuccessfulPortalDeploymentEmail () {
mail to: "${params.NOTIFICATION_EMAIL}",
subject: "Successful Portal Deployment: ${currentBuild.fullDisplayName}",
body: "The changes have been successfully deployed to Discover Portal."
}

Wyświetl plik

@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: xc8-mplabx
spec:
containers:
- name: xc8-mplabx
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc8-mplabx:latest
imagePullPolicy: Always
command: ['cat']
tty: true
resources:
requests:
cpu: 1
memory: 4Gi
limits:
cpu: 2
memory: 8Gi

13
.gitignore vendored 100644
Wyświetl plik

@ -0,0 +1,13 @@
# Untracked files in MPLABX projects
/**/build/*
/**/nbproject/*
!/**/nbproject/*.xml
/**/[Ff]ree/production/*
/**/[Pp]ro/production/*
/**/.generated_files/*
# Uncomment these to include hex/elf files
#!/**/[Ff]ree/production/*.hex
#!/**/[Ff]ree/production/*.elf
#!/**/[Pp]ro/production/*.hex
#!/**/[Pp]ro/production/*.elf

Wyświetl plik

@ -0,0 +1,58 @@
{
"metaDataVersion": "1.0.0",
"category": "com.microchip.ide.project",
"content": {
"metaDataVersion": "1.1.0",
"name": "com.microchip.mcu8.mplabx.project.avr128da48-cnano-ws2812-mplab-mcc",
"version": "1.0.0",
"displayName": " ",
"projectName": "avr128da48-cnano-ws2812-mplab-mcc",
"shortDescription": "",
"ide": {
"name": "MPLAB X",
"semverRange": ""
},
"compiler": [
{
"name": "XC8",
"semverRange": ""
}
],
"dfp": {
"name": "",
"semverRange": ""
},
"configurator": {
"name": "",
"semverRange": ""
},
"device": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.portal.contentRef",
"content": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.device",
"name": "",
"versionRange": "*"
}
},
"author": "",
"subcategories": [
],
"peripherals": [
],
"keywords": [
],
"additionalData": {
"longDescription": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.portal.fileRef",
"content": {
"metaDataVersion": "1.0.0",
"fileName": "./README.md",
"mimeType": "text/markdown"
}
}
}
}
}

20
LICENSE.txt 100644
Wyświetl plik

@ -0,0 +1,20 @@
(c) 2020 Microchip Technology Inc. and its subsidiaries.
Subject to your compliance with these terms, you may use Microchip software
and any derivatives exclusively with Microchip products. You're responsible
for complying with 3rd party license terms applicable to your use of 3rd
party software (including open source software) that may accompany Microchip
software.
SOFTWARE IS "AS IS." NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY,
APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP
HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO
THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL
CLAIMS RELATED TO THE SOFTWARE WILL NOT EXCEED AMOUNT OF FEES, IF ANY,
YOU PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.

Wyświetl plik

@ -0,0 +1,41 @@
<!-- Please do not change this logo with link -->
[![MCHP](images/microchip.png)](https://www.microchip.com)
# Update the title for avr128da48-cnano-ws2812-mplab-mcc here
<!-- This is where the introduction to the example goes, including mentioning the peripherals used -->
## Related Documentation
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
In addition a link to the device family landing page and relevant peripheral pages as well:
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
## Software Used
<!-- All software used in this example must be listed here. Use unbreakable links!
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
- 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)
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
## Hardware Used
<!-- All hardware used in this example must be listed here. Use unbreakable links!
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
## Setup
<!-- 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 -->
## Operation
<!-- Explain how to operate the example. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
## Summary
<!-- Summarize what the example has shown -->

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 5.5 KiB