Add timestamp to report file names for scripts which run tests
* Added functions.sh file to store reusable bash functions
* Replaced 'latest' in generated report names by timestamps
Related-PROD: PROD-37187
Change-Id: I9e2bc7989a685b0f2f94fb909a8f2f1cc7a6d803
diff --git a/k8s/workspace/functions.sh b/k8s/workspace/functions.sh
new file mode 100644
index 0000000..e6c6a1a
--- /dev/null
+++ b/k8s/workspace/functions.sh
@@ -0,0 +1,10 @@
+get_timestamp() {
+ # "update_latest_report" depends on this pattern (it looks for '%Y' which
+ # should match "20[0-9]{2} in this century).
+ # Make changes in "update_latest_report" if you change timestamp here
+ date +%Y-%m-%dT%H-%M
+}
+
+update_latest_report_to() {
+ cp "$1" "$(echo $1|sed s/20[0-9]\\{2\\}.*/latest.html/)"
+}
\ No newline at end of file