Compare commits
10 Commits
27fc4e4f34
...
541659b470
| Author | SHA1 | Date |
|---|---|---|
|
|
541659b470 | |
|
|
fd85d1b125 | |
|
|
adb5a5f598 | |
|
|
d17e4d5ef5 | |
|
|
7c227b2280 | |
|
|
b238d41526 | |
|
|
fda5ab5a80 | |
|
|
7f1f8624a3 | |
|
|
cbf2c687d1 | |
|
|
31a40bc595 |
|
|
@ -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 'libraryBuild'}
|
||||
agent {label 'jaws-slaves'}
|
||||
parameters {
|
||||
string(name: 'FROMDATE', defaultValue: '', description: 'Enter from date in format YYYY-MM-DD e.g. 2021-11-01')
|
||||
|
||||
|
|
@ -32,13 +32,14 @@
|
|||
//here comes the trigger according to crontabs - jenkins is in UTC
|
||||
triggers {
|
||||
//every 1st of every month at 00:00
|
||||
//cron('0 0 1 * *')
|
||||
// currently this branch is not used, so dont start it at all
|
||||
// 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')
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -47,12 +48,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')
|
||||
|
|
@ -76,7 +77,7 @@
|
|||
stage('Execute Reporting Script') {
|
||||
steps {
|
||||
|
||||
sh 'python createReport.py -p week'
|
||||
sh 'python createReport.py -p month'
|
||||
|
||||
|
||||
//Only required once CN is not reachable from EMEA
|
||||
|
|
@ -90,8 +91,9 @@
|
|||
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',
|
||||
//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',
|
||||
replyTo: 'coco-apm@bmw.de',
|
||||
attachmentsPattern: '*.xlsx'
|
||||
|
||||
|
|
@ -105,8 +107,18 @@
|
|||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@ 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)
|
||||
|
|
@ -40,6 +43,8 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate):
|
|||
|
||||
if (DTENV.find('dynatracemgd') != -1):
|
||||
verify=False
|
||||
if (DTENV.find('dyna-synt') != -1):
|
||||
verify=False
|
||||
else:
|
||||
verify=True
|
||||
|
||||
|
|
@ -54,7 +59,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)
|
||||
|
|
@ -69,7 +74,7 @@ def getSLO(DTAPIToken, DTENV, fromDate, toDate):
|
|||
print(e)
|
||||
print("No SLO json returned")
|
||||
print(parameters)
|
||||
print(r.content)
|
||||
print(r)
|
||||
df = pd.DataFrame()
|
||||
|
||||
|
||||
|
|
@ -225,11 +230,11 @@ def main():
|
|||
dailyall = dailyall[dailyall['Touchpoint'].isin(touchpoints)]
|
||||
totalall = totalall[totalall['Touchpoint'].isin(touchpoints)]
|
||||
|
||||
writer = pd.ExcelWriter("./QM_Report.xlsx")
|
||||
writer = pd.ExcelWriter("./QM_Report_" + str(fromDate.isocalendar()[1]) + ".xlsx")
|
||||
totalall.to_excel(writer, sheet_name='total')
|
||||
dailyall.to_excel(writer, sheet_name='daily')
|
||||
writer.save()
|
||||
writer.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ naprod:
|
|||
- jenkins: "https://jaws.bmwgroup.net/opapm/"
|
||||
cnprod:
|
||||
- name: "cnprod"
|
||||
- env-url: "https://dynatracemgd-tsp.bmwgroup.net/e/b921f1b9-c00e-4031-b9d1-f5a0d530757b"
|
||||
- env-url: "https://dyna-synth-cn.bmwgroup.com.cn/e/b921f1b9-c00e-4031-b9d1-f5a0d530757b"
|
||||
- env-token-name: "CNPROD_TOKEN_VAR"
|
||||
- jenkins: "https://jaws-china.bmwgroup.net/opmaas/"
|
||||
#cnpreprod:
|
||||
|
|
|
|||
Loading…
Reference in New Issue