MCU8QA-162 added new CICD files

master
Adith Kumar Urs 2020-07-21 13:01:09 +05:30
rodzic 1b138e2e96
commit b3eb2c25ef
4 zmienionych plików z 138 dodań i 12 usunięć

18
.gitignore vendored
Wyświetl plik

@ -1,6 +1,12 @@
/*/dist/
/*/build/
/*/nbproject/private/
/*/nbproject/*.properties
/*/nbproject/*.mk
/*/nbproject/*.bash
# Untracked files in MPLABX projects
/**/build/*
/**/nbproject/*
!/**/nbproject/*.xml
/**/[Ff]ree/production/*
/**/[Pp]ro/production/*
# 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,68 @@
{
"metaDataVersion": "1.0.0",
"category": "com.microchip.ide.project",
"content": {
"metaDataVersion": "1.1.0",
"name": "com.microchip.mcu8.mplabx.project.",
"version": " ",
"displayName": " ",
"projectName": "",
"shortDescription": "",
"ide": {
"name": "",
"semverRange": ""
},
"compiler": [
{
"name": "",
"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", ""
],
[
"Peripherals", ""
]
],
"peripherals": [
"",""
],
"keywords": [
"",
""
],
"additionalData": {
"longDescription": {
"metaDataVersion": "1.0.0",
"category": "com.microchip.portal.fileRef",
"content": {
"metaDataVersion": "1.0.0",
"fileName": "./README.md",
"mimeType": "text/markdown"
}
}
}
}
}

Wyświetl plik

@ -1,3 +1,5 @@
// Jenkinsfilek8s v1.2.0
pipeline {
agent {
kubernetes {
@ -13,7 +15,8 @@ pipeline {
description: "Email to send build failure and fixed notifications.")
}
environment {
environment {
GITHUB_OWNER = 'microchip-pic-avr-examples'
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/avr128da48-cnano-adc-temperature-measurement.git'
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/avr128da48-cnano-adc-temperature-measurement.git'
DEPLOY_TOOL_URL = 'https://bitbucket.microchip.com/scm/citd/tool-github-deploy.git'
@ -23,7 +26,7 @@ pipeline {
options {
timestamps()
timeout(time: 20, unit: 'MINUTES')
timeout(time: 30, unit: 'MINUTES')
}
stages {
@ -33,6 +36,17 @@ pipeline {
}
}
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 {
@ -56,7 +70,7 @@ pipeline {
}
}
stage('Deploy') {
stage('GitHub-Deploy') {
when {
not {
changeRequest()
@ -76,8 +90,40 @@ pipeline {
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 {
@ -113,6 +159,12 @@ def sendPipelineFailureEmail () {
def sendSuccessfulGithubDeploymentEmail () {
mail to: "${params.NOTIFICATION_EMAIL}",
subject: "Successful Deployment: ${currentBuild.fullDisplayName}",
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

@ -5,7 +5,7 @@ metadata:
spec:
containers:
- name: xc8-mplabx
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc8-mplabx:2.20-5.40
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc8-mplabx:latest
imagePullPolicy: Always
command: ['cat']
tty: true