Compare commits

..

No commits in common. "541659b4708aff4f389d7ac26434f7bef8c11976" and "27fc4e4f34d6b99c1b77a10bfd88dda7b09c9d17" have entirely different histories.

3 changed files with 18 additions and 35 deletions

38
Jenkinsfile vendored
View File

@ -22,7 +22,7 @@
ansiColor('xterm')
}
//label libraryBuild is available in CN JAWS and ROW JAWS, therefore this one was used; no additional intents
agent {label 'jaws-slaves'}
agent {label 'libraryBuild'}
parameters {
string(name: 'FROMDATE', defaultValue: '', description: 'Enter from date in format YYYY-MM-DD e.g. 2021-11-01')
@ -32,14 +32,13 @@
//here comes the trigger according to crontabs - jenkins is in UTC
triggers {
//every 1st of every month at 00:00
// currently this branch is not used, so dont start it at all
// cron('0 0 1 * *')
//cron('0 0 1 * *')
//every day at 08:00
//cron('0 8 * * *')
//every monday at 08:00
//cron('0 8 * * 1')
cron('0 8 * * 1')
}
@ -48,12 +47,12 @@
AUTH = credentials('proxy')
proxy_user = "${AUTH_USR}"
proxy_pw = "${AUTH_PSW}"
//http_proxy="http://${proxy_user}:${proxy_pw}@proxy.muc:8080"
//https_proxy="http://${proxy_user}:${proxy_pw}@proxy.muc:8080"
//no_proxy="localhost,127.0.0.1,.muc,.bmwgroup.net"
//HTTP_PROXY="${http_proxy}"
//HTTPS_PROXY="${https_proxy}"
//NO_PROXY="${no_proxy}"
http_proxy="http://${proxy_user}:${proxy_pw}@proxy.muc:8080"
https_proxy="http://${proxy_user}:${proxy_pw}@proxy.muc:8080"
no_proxy="localhost,127.0.0.1,.muc,.bmwgroup.net"
HTTP_PROXY="${http_proxy}"
HTTPS_PROXY="${https_proxy}"
NO_PROXY="${no_proxy}"
EUPROD_TOKEN_VAR = credentials('EUPROD_TOKEN_VAR')
EUPREPROD_TOKEN_VAR = credentials('EUPREPROD_TOKEN_VAR')
@ -77,7 +76,7 @@
stage('Execute Reporting Script') {
steps {
sh 'python createReport.py -p month'
sh 'python createReport.py -p week'
//Only required once CN is not reachable from EMEA
@ -91,9 +90,8 @@
try {
emailext subject: env.JOB_NAME,
body: 'Please find the output of the weekly QM-Report attached',
//to: 'rene.forstner@nttdata.com',
//to: 'rene.forstner@nttdata.com, stephan.oertelt@bmw.de, Mohammed.Abadel@bmw.de, OOC-Support@bmwgroup.com, Sonja.Yildizoglu@bmw.de, Andreas.DA.Danzer@partner.bmw.de',
to: 'rene.forstner@nttdata.com, stephan.oertelt@bmw.de, Mohammed.Abadel@bmw.de, andreas.db.danzer@bmwgroup.com',
to: 'rene.forstner@nttdata.com',
//to: 'rene.forstner@nttdata.com, stephan.oertelt@bmw.de, Mohammed.Abadel@bmw.de, OOC-Support@bmwgroup.com, Sonja.Yildizoglu@bmw.de, Andreas.DA.Danzer@partner.bmw.de',
replyTo: 'coco-apm@bmw.de',
attachmentsPattern: '*.xlsx'
@ -107,18 +105,8 @@
}
post {
failure {
emailext subject: "${env.JOB_NAME} build ${env.BUILD_ID} failed",
body: "QM report failed, see logs for details: ${env.BUILD_URL}",
to: 'BMW.CoCo.Dynatrace@nttdata.com, ermis.wieger@nttdata.com, Andreas.DB.Danzer@bmwgroup.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}",
// status: 'Failure',
// color: "d00000"
}
always {
cleanWs()
}
}
}
}

View File

@ -7,10 +7,7 @@ import pandas as pd
import requests
import openpyxl
import argparse
import os
os.environ['TZ'] = 'Europe/Berlin' # set new timezone
time.tzset()
def make_request(url, headers,verify,parameters):
try:
response = requests.get(url, headers=headers,verify=verify,params=parameters)
@ -43,8 +40,6 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate):
if (DTENV.find('dynatracemgd') != -1):
verify=False
if (DTENV.find('dyna-synt') != -1):
verify=False
else:
verify=True
@ -59,7 +54,7 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate):
"from": int(fromDate),
"to": int(toDate),
"timeFrame": "GTF",
"evaluate": "true",
"evaluate": True,
"sloSelector": "text(\"CoCo-QM-Report\")"
}
r = make_request(DTAPIURL,headers=headers,parameters=parameters,verify=verify)
@ -74,7 +69,7 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate):
print(e)
print("No SLO json returned")
print(parameters)
print(r)
print(r.content)
df = pd.DataFrame()
@ -230,11 +225,11 @@ def main():
dailyall = dailyall[dailyall['Touchpoint'].isin(touchpoints)]
totalall = totalall[totalall['Touchpoint'].isin(touchpoints)]
writer = pd.ExcelWriter("./QM_Report_" + str(fromDate.isocalendar()[1]) + ".xlsx")
writer = pd.ExcelWriter("./QM_Report.xlsx")
totalall.to_excel(writer, sheet_name='total')
dailyall.to_excel(writer, sheet_name='daily')
writer.save()
writer.close()
if __name__ == "__main__":
main()
main()

View File

@ -20,7 +20,7 @@ naprod:
- jenkins: "https://jaws.bmwgroup.net/opapm/"
cnprod:
- name: "cnprod"
- env-url: "https://dyna-synth-cn.bmwgroup.com.cn/e/b921f1b9-c00e-4031-b9d1-f5a0d530757b"
- env-url: "https://dynatracemgd-tsp.bmwgroup.net/e/b921f1b9-c00e-4031-b9d1-f5a0d530757b"
- env-token-name: "CNPROD_TOKEN_VAR"
- jenkins: "https://jaws-china.bmwgroup.net/opmaas/"
#cnpreprod: