forked from camunda/camunda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createMedicCWBenchmark.sh
executable file
·56 lines (42 loc) · 1.45 KB
/
createMedicCWBenchmark.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
#!/bin/bash
set -euxo pipefail
# Make sure git index is clean
git diff-index --quiet HEAD -- || \
(echo "You have a dirty git index, please clean it"; exit 1)
test -z "$(git ls-files --exclude-standard --others)" || \
(echo "You have untracked files, please clean your git repo"; exit 1)
# Ensure you are on zeebe-cluster
kubectx gke_zeebe-io_europe-west1-b_zeebe-cluster
# switch do main
git checkout main
# get latest changes
git fetch
git pull origin main
# switch to cw branch
git checkout medic-cw-benchmarks
git pull origin medic-cw-benchmarks
# update kw branch
git merge main --no-edit
git push origin medic-cw-benchmarks
# create new kw image and deploy benchmark
./setupKWBenchmark.sh
# delete older benchmark
cd benchmarks/setup/
cw=$(date +%V)
if [ $cw -gt 4 ]
then
nameOfOldestBenchmark=$(ls | grep medic-y- | sort | head -n 1)
./deleteBenchmark.sh $nameOfOldestBenchmark
# commit that change
git commit -am "test(benchmark): rm $nameOfOldestBenchmark"
git push origin medic-cw-benchmarks
else
set +x
echo -e "\e[31m!!!!!!!!!!!!!!"
echo -e "We currently not support to delete benchmarks, before calendar week 5. Our deletion logic is not sophisticated enough. Please delete the benchmark manually."
echo -e "!!!!!!!!!!!!!!\e[0m"
set -x
fi
# print out the name of the new benchmark so it can be easily copied
nameOfNewestBenchmark=$(ls | grep medic-y- | sort | tail -n 1)
echo "Finished creating new medic benchmark: $nameOfNewestBenchmark"