Skip to content

Commit 8750451

Browse files
committed
Update notify workflow to optionally take artillery key
1 parent 392af23 commit 8750451

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

scripts/run_notify_load_test.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ if [ -z "${arrivalRate}" ]; then
2626
exit 1
2727
fi
2828

29-
if ! [[ "${environment}" =~ ^(dev|ref)$ ]]
30-
then
29+
if ! [[ "${environment}" =~ ^(dev|ref)$ ]]; then
3130
echo "environment must be dev or ref"
3231
exit 1
3332
fi
@@ -40,11 +39,18 @@ export vpc_subnets
4039
artillery_worker_role_name=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "artillery-resources:ArtilleryWorkerRoleName") | .Value' | grep -o '[^:]*$')
4140
export artillery_worker_role_name
4241

42+
if [ -z "${artillery_key}" ]; then
43+
echo "artillery_key is unset. Running without --record to Artillery Cloud."
44+
RECORD_ARGS=""
45+
else
46+
RECORD_ARGS="--record --key ${artillery_key}"
47+
fi
48+
4349
cat <<EOF > runtimeenv.env
44-
maxVusers=$maxVusers
45-
duration=$duration
46-
arrivalRate=$arrivalRate
47-
rampUpDuration=$rampUpDuration
50+
maxVusers=${maxVusers}
51+
duration=${duration}
52+
arrivalRate=${arrivalRate}
53+
rampUpDuration=${rampUpDuration}
4854
EOF
4955

5056
echo ${launch_config}
@@ -60,6 +66,7 @@ npx artillery run-fargate \
6066
--task-role-name "${artillery_worker_role_name}" \
6167
--env-file runtimeenv.env \
6268
--output notify_load_test.json \
69+
$RECORD_ARGS \
6370
artillery/notify_load_test.yml
6471

65-
npx artillery report notify_load_test.json
72+
npx artillery report notify_load_test.json

0 commit comments

Comments
 (0)