forked from kieker-monitoring/moobench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.sh
executable file
·78 lines (60 loc) · 2.38 KB
/
upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#
# Kieker moobench upload script
#
# Usage: upload.sh
# configure base dir
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
KEYSTORE="$1"
UPDATE_SITE_URL="$2"
#
# source functionality
#
if [ ! -d "${BASE_DIR}" ] ; then
echo "Base directory ${BASE_DIR} does not exist."
exit 1
fi
# load configuration and common functions
if [ -f "${BASE_DIR}/config.rc" ] ; then
source "${BASE_DIR}/config.rc"
else
echo "Missing configuration: ${BASE_DIR}/config.rc"
exit 1
fi
if [ -f "${BASE_DIR}/common-functions.sh" ] ; then
source "${BASE_DIR}/common-functions.sh"
else
echo "Missing library: ${BASE_DIR}/common-functions.sh"
exit 1
fi
checkExecutable compile-results "${COMPILE_RESULTS_BIN}"
checkFile keystore "${KEYSTORE}"
checkDirectory results "${BASE_DIR}/results" recreate
if [ "${UPDATE_SITE_URL}" == "" ] ; then
error "Missing UPDATE_SITE_URL"
info "Usage: $0 KEYSTORE UPDATE_SITE_URL"
exit 1
fi
# Retrieve logs
cd results
info "Get Kieker-java log"
sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}/Kieker-java-log.yaml
info "Get Kieker-python log"
sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}/Kieker-python-log.yaml
info "Get OpenTelemetry log"
sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}/OpenTelemetry-java-log.yaml
info "Get inspectIT log"
sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}/inspectIT-java-log.yaml
cd ..
# Compute logs and charts
info "Compute new logs and charts"
"${COMPILE_RESULTS_BIN}" -i *-results.yaml -l results -c results -t results -w 100
# Stash results back onto the update site
info "Push logs and results"
cd results
echo "put *.yaml" | sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}
echo "put *.html" | sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}
echo "put *.json" | sftp -oNoHostAuthenticationForLocalhost=yes -oStrictHostKeyChecking=no -oUser=repo -F /dev/null -i ${KEYSTORE} ${UPDATE_SITE_URL}
cd ..
info "Done"
# end