-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-start-docker.sh
executable file
·66 lines (54 loc) · 1.96 KB
/
local-start-docker.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
#! /bin/bash
# TODO: parametrizzare con
# 1) Nome dello script da eseguire (di default src/DeliverySendNotification.js ).
# N.B: il prefisso src/ sarà sottointeso
# 2) Nome del sottofolder in cui scrivere gli output. Ad esempio /outputs/${valore_di_questo_parametro}
# 3) Avere una modalità che non lancia i test ma scarica le metriche cloudwatch nel lasso di tempo di
# esecuzione della run indicata dal secondo parametro.
if ( [ "$#" -ne "3" ]) then
echo "Usage $0 <env_file> <output_subfolder> <command>"
echo " where command could be: run download, clean_dlq"
exit 1
fi
export LOCAL_HOME=$HOME
credentials_files=$1
output_subfolder=$2
execution_or_download=$3
if ( [ "$execution_or_download" == "run" ] ) then
mkdir -p $(pwd)/outputs/$output_subfolder
echo "======= Rebuild Image"
docker build --rm -t k6 .
echo "======= Run K6"
docker run --rm -ti --env-file $credentials_files \
-v $(pwd)/outputs/$output_subfolder:/outputs/ \
k6 run \
--log-format json \
src/DeliverySendAndReceiverGetDownload.js \
--out json=/outputs/result-timing.json \
--http-debug \
--console-output=/outputs/console-output.txt \
--log-output=file=/outputs/http-output.json
elif ( [ "$execution_or_download" == "download" ] ) then
echo "======= Rebuild Image"
docker build --rm -t k6 .
echo "======= Download statistics"
docker run --rm -ti \
-v $(pwd)/outputs/$output_subfolder:/outputs/ \
-v "${LOCAL_HOME}/.aws":/root/.aws \
--entrypoint /tests/get_test_metrics/get_test_metrics_by_folder.sh \
k6 \
-f /outputs/ \
-r eu-south-1 \
-p sso_pn-core-dev \
-c sso_pn-confinfo-dev
elif ( [ "$execution_or_download" == "clean_dlq" ] ) then
docker run --rm -ti \
-v $(pwd)/outputs/$output_subfolder:/outputs/ \
-v "${LOCAL_HOME}/.aws":/root/.aws \
--entrypoint /tests/get_test_metrics/clean_dlq.sh \
k6 \
-f /outputs/ \
-r eu-south-1 \
-p sso_pn-core-dev \
-c sso_pn-confinfo-dev
fi