MPAE-9957 update jenkins and yaml files

master
Marius Nicolae 2021-02-17 11:42:05 +02:00
rodzic efb7e8dfa2
commit a6a55cbc80
2 zmienionych plików z 30 dodań i 90 usunięć

Wyświetl plik

@ -6,91 +6,44 @@ pipeline {
yamlFile 'cloudprovider.yml'
}
}
parameters {
string( name: 'NOTIFICATION_EMAIL',
defaultValue: 'PICAVR_Examples_GateKeepers@microchip.com',
description: "Email to send build failure and fixed notifications.")
}
environment {
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/avr128da48-cnano-led-blink-pwm-mcc.git'
environment {
GITHUB_OWNER = 'microchip-pic-avr-examples'
GITHUB_URL ='https://github.com/microchip-pic-avr-examples/avr128da48-cnano-led-blink-pwm-mcc'
BITBUCKET_URL = 'https://bitbucket.microchip.com/scm/ebe/avr128da48-cnano-led-blink-pwm-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'
SEMVER_REGEX = '^(0|[1-9]\\d*)+\\.(0|[1-9]\\d*)+\\.(0|[1-9]\\d*)+$'
ARTIFACTORY_SERVER = 'https://artifacts.microchip.com:7999/artifactory'
}
options {
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
options {
timestamps()
timeout(time: 20, unit: 'MINUTES')
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
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}")
stages {
stage('setup') {
steps {
script {
execute("git clone https://bitbucket.microchip.com/scm/citd/mpae-buildpipeline-groovy-scripts.git")
def buildPipeline = load ('mpae-buildpipeline-groovy-scripts/xc8mplabx-buildpipeline.groovy')
buildPipeline.runStages()
}
}
}
}
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('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()
}
}
}
}
post {
post {
failure {
script {
sendPipelineFailureEmail()
}
}
always {
archiveArtifacts artifacts: "tool-mplabx-c-build/output/**", allowEmptyArchive: true, fingerprint: true
}
}
}
}
}
def execute(String cmd) {
if(isUnix()) {
sh cmd
@ -98,21 +51,8 @@ def execute(String cmd) {
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 Deployment: ${currentBuild.fullDisplayName}",
body: "The changes have been successfully deployed to GitHub. ${env.GITHUB_URL}"
def sendPipelineFailureEmail() {
mail to: "${env.EMAILLIST},${params.NOTIFICATION_EMAIL}",
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Pipeline failure. ${env.BUILD_URL}"
}

Wyświetl plik

@ -5,14 +5,14 @@ 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
resources:
requests:
cpu: 1
memory: 4Gi
cpu: 0.25
memory: 500Mi
limits:
cpu: 2
memory: 8Gi
cpu: 0.5
memory: 750Mi