diff --git a/Jenkinsfile b/Jenkinsfile index 3fc1aeb..4cd0508 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,7 @@ pipeline { string(name: 'TODATE', defaultValue: '', description: 'Enter to date in format YYYY-MM-DD e.g. 2021-11-30') string(name: 'PRESELECT', defaultValue: 'day', description: 'Enter day | week | month (without |) - auto selects the last full day, week or month') string(name: 'SLICES', defaultValue: 'dt', description: 'Enter h | d | t | y (without spaces or |) - writes the slices hourly, daily, total or year to date into excel given in any order') + string(name: 'KPI_EXTENSION', defaultValue: 'true', description: 'Enter true or false if the extension should be executed') } // here comes the trigger according to crontabs - jenkins is in UTC @@ -69,7 +70,9 @@ pipeline { CNPREPROD_TOKEN_VAR = credentials('CNPREPROD_TOKEN_VAR') EUPRODSAAS_TOKEN_VAR = credentials('EUPRODSAAS_TOKEN_VAR') FROM_DATE="${params.FROMDATE}" - TO_DATE="${params.TODATE}" + TO_DATE="${params.TODATE}" + REPORT_TYPE="${params.PRESELECT}" + KPI_EXTENSION="${params.KPI_EXTENSION}" } stages { @@ -157,6 +160,12 @@ pipeline { sh "python3 createReport.py ${SCRIPT_PARAMETER}" sh "python3 summary.py" summary = readFile('summary.txt').trim() + + if (KPI_EXTENSION=='true') { + echo "Executing KPI Extension" + sh "python3 kpi_extension.py" + } + } } @@ -180,7 +189,10 @@ pipeline { // to: 'rene.forstner@nttdata.com, ermis.wieger@nttdata.com, patryk.gudalewicz.bp@nttdata.com', // to: 'patryk.gudalewicz.bp@nttdata.com', // to: 'rene.forstner@nttdata.com, ermis.wieger@nttdata.com, arnel.arnautovic@nttdata.com, patryk.gudalewicz.bp@nttdata.com, stephan.oertelt@bmw.de, Mohammed.Abadel@bmw.de, michaela.jaeger@bmw.de, OOC-Support@bmwgroup.com, Andreas.DB.Danzer@bmwgroup.com', - to: 'Andreas.DB.Danzer@bmwgroup.com, Arnel.Arnautovic@nttdata.com, Ermis.Wieger@nttdata.com', + // original recipients below + // to: 'Andreas.DB.Danzer@bmwgroup.com, Arnel.Arnautovic@nttdata.com, Ermis.Wieger@nttdata.com', + // test: + to: 'Daniel.Mikula@nttdata.com, Arnel.Arnautovic@nttdata.com', replyTo: 'coco-apm@bmw.de', attachmentsPattern: '*.xlsx' } catch ( mailExc ) { @@ -196,7 +208,7 @@ pipeline { failure { emailext subject: "${env.JOB_NAME} build ${env.BUILD_ID} failed", body: "QM report failed, see logs for details: ${env.BUILD_URL}", - to: 'Arnel.Arnautovic@nttdata.com' + to: 'Arnel.Arnautovic@nttdata.com, Daniel.Mikula@nttdata.com' // to post to the teams channel "0 - APM Service Desk" just uncomment the following command: // office365ConnectorSend webhookUrl: "https://bmwgroup.webhook.office.com/webhookb2/483edc00-c925-4672-8088-8299a0139fca@ce849bab-cc1c-465b-b62e-18f07c9ac198/JenkinsCI/9aca6923685b40f794134853fcbe88f1/ff31bcee-96b3-4481-9bd8-4f74180b263b", // message: "QM report failed, see logs for details: ${env.BUILD_URL}",