Compare commits

...

10 Commits

Author SHA1 Message Date
PATRYK GUDALEWICZ (ext.) fb5eec9317 Jenkinsfile edited online with Bitbucket
switching to python 3.9
2023-07-17 08:20:29 +00:00
PATRYK GUDALEWICZ (ext.) 4b971989a6 Jenkinsfile edited online with Bitbucket
Adding distutils reference during python installation
2023-07-17 07:26:29 +00:00
Peter Oehmichen be24c40b5b corrected Xibix Address 2023-07-04 09:15:16 +02:00
Andreas Danzer (DE-701) 8c6f0298c0 Jenkinsfile online editiert mit Bitbucket
added johann
2023-07-03 11:16:28 +00:00
Daniel Mikula a9fff61fa9 set recipients back to production 2023-07-03 11:59:48 +02:00
Daniel Mikula c7ca2d7f93 set recipients to test 2023-07-03 10:14:10 +02:00
SLW\ARNAUA 42c7907ec7 OPMAAS-4466 - Change recipient for reports 2023-06-21 12:17:00 +02:00
QXZ3NHY cc7d608852 set recipients to production 2023-06-20 12:07:27 +02:00
QXZ3NHY 719cf8e673 set recipients to production 2023-06-20 11:20:25 +02:00
QXZ3NHY b6320b8417 test - csv 2023-06-20 11:08:40 +02:00
1 changed files with 24 additions and 14 deletions

38
Jenkinsfile vendored
View File

@ -18,6 +18,7 @@ pipeline {
string(name: 'PRESELECT', defaultValue: 'week', 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')
string(name: 'FORMATS', defaultValue: 'xc', description: 'Enter x | c (without spaces or |) - creates xlsx (x) and/or CSV (c) file - the csv file will include a reduced list (depending on target report)')
}
// here comes the trigger according to crontabs - jenkins is in UTC
@ -85,12 +86,13 @@ pipeline {
}
sh """
sudo add-apt-repository ppa:deadsnakes/ppa -y && \
sudo apt install python3.8 -y && \
python3.8 --version
curl https://bootstrap.pypa.io/get-pip.py | python3.8
python3.8 -m pip --version
python3.8 -m pip install -r requirements.txt
python3.8 -m pip install git+https://${AUTH_USR}:${AUTH_PSW}@atc.bmwgroup.net/bitbucket/scm/opapm/keyrequestparser.git
sudo apt install python3.9 -y && \
sudo apt install python3.9-distutils -y && \
python3.9 --version
curl https://bootstrap.pypa.io/get-pip.py | python3.9
python3.9 -m pip --version
python3.9 -m pip install -r requirements.txt
python3.9 -m pip install git+https://${AUTH_USR}:${AUTH_PSW}@atc.bmwgroup.net/bitbucket/scm/opapm/keyrequestparser.git
"""
}
}
@ -136,14 +138,22 @@ pipeline {
SCRIPT_PARAMETER = SCRIPT_PARAMETER + " -p " + PRESELECT.toString()
}
if (FORMATS.isEmpty()) {
currentBuild.result = 'ABORTED'
error('Aborting due to missing report format parameter')
return
} else {
SCRIPT_PARAMETER = SCRIPT_PARAMETER + " -o " + FORMATS.toString()
}
echo "${SCRIPT_PARAMETER}"
sh "python3.8 createReport.py ${SCRIPT_PARAMETER}"
sh "python3.8 summary.py"
sh "python3.9 createReport.py ${SCRIPT_PARAMETER}"
sh "python3.9 summary.py"
summary = readFile('summary.txt').trim()
if (KPI_EXTENSION=='true') {
echo "Executing KPI Extension"
sh "python3.8 kpi_extension.py"
sh "python3.9 kpi_extension.py"
}
}
@ -160,14 +170,14 @@ pipeline {
script {
dir("/opt/workspace/qm_report/") {
try {
emailext subject: "NEW ${env.JOB_NAME}",
emailext subject: "THE OFFICIAL ${env.JOB_NAME}",
mimeType: 'text/html',
body: "Please find the output of the daily QM-Report attached </br></br>${summary}",
to: 'ermis.wieger@nttdata.com, Andreas.DB.Danzer@bmwgroup.com, OOC-Support@bmwgroup.com, michaela.jaeger@bmw.de, thilo.bindel@bmwgroup.com, Mohammed.Abadel@bmw.de, jan.sc.schaefer@bmw.de, ops-xibix@list.bmw.com, omo-xibix@list.bmw.com',
to: 'Ermis.Wieger@nttdata.com, Andreas.DB.Danzer@bmwgroup.com, OOC-Support@bmwgroup.com, Michaela.Jaeger@bmw.de, Thilo.Bindel@bmwgroup.com, Mohammed.Abadel@bmw.de, Jan.SC.Schaefer@bmw.de, omt-xibix@list.bmw.com, johann.wildgruber@bmwgroup.com',
// test:
// to: 'Daniel.Mikula@nttdata.com, Arnel.Arnautovic@nttdata.com',
replyTo: 'coco-apm@bmw.de',
attachmentsPattern: '*.xlsx'
attachmentsPattern: '*.xlsx, *.csv'
} catch ( mailExc ) {
echo "Sending Email Failed: ${mailExc}"
}
@ -179,9 +189,9 @@ pipeline {
post {
failure {
emailext subject: "${env.JOB_NAME} build ${env.BUILD_ID} failed",
emailext subject: "THE OFFICIAL ${env.JOB_NAME} build ${env.BUILD_ID} failed",
body: "QM report failed, see logs for details: ${env.BUILD_URL}",
to: 'Arnel.Arnautovic@nttdata.com, Daniel.Mikula@nttdata.com'
to: 'Arnel.Arnautovic@nttdata.com, Daniel.Mikula@nttdata.com, ops-xibix@list.bmw.com, omt-xibix@list.bmw.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}",