From adc20832266a946c7bf908c8c437b1cedf4fc142 Mon Sep 17 00:00:00 2001 From: scherniavsky Date: Thu, 14 Jun 2018 12:47:56 +0200 Subject: [PATCH 1/3] Fixes: docker-compose doesn't exit, docker-compose waits unnecessary time for the reports to become ready, in plain docker mode the reports folder is created with wrong permissions', reports --- local.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/local.sh b/local.sh index 4ef12a6..6e9ce89 100755 --- a/local.sh +++ b/local.sh @@ -161,17 +161,20 @@ EOF (export IMAGE=$IMAGE && export TARGET_HOST=$TARGET && export LOCUST_FILE=$LOCUST_FILE && export SLAVE_NUM=$SLAVES && export AUTOMATIC=$AUTOMATIC && export USERS=$USERS && export HATCH_RATE=$HATCH_RATE && export DURATION=$DURATION && export OAUTH=$OAUTH && URL=$URL && export SEND_ANONYMOUS_USAGE_INFO=$KPI && - export SCOPES=$SCOPES && export BUILD_URL=$BUILD_URL && docker-compose up) - - echo "Locust application is successfully deployed. you can access http://:8089" + export SCOPES=$SCOPES && export BUILD_URL=$BUILD_URL && docker-compose up --abort-on-container-exit) if $AUTOMATIC; then - sleep 8 sleep $DURATION docker cp docker_locusts_controller:/opt/reports . + else + echo "Locust application is successfully deployed. you can access http://:8089" fi + else echo "Run in standalone mode" + + [[ ! -d "./reports" ]] && mkdir reports + docker run -i --rm -v $PWD/reports:/opt/reports -v ~/.aws:/root/.aws -v $PWD/:/opt/script \ -v $PWD/credentials:/meta/credentials -p 8089:8089 -e ROLE=standalone -e TARGET_HOST=$TARGET \ -e LOCUST_FILE=$LOCUST_FILE -e SLAVE_MUL=$SLAVES -e AUTOMATIC=$AUTOMATIC -e USERS=$USERS \ From 3db19454e5eb8818539236f275215608aeeda022 Mon Sep 17 00:00:00 2001 From: scherniavsky Date: Thu, 14 Jun 2018 13:38:39 +0200 Subject: [PATCH 2/3] Fixes: docker-compose in manual mode broken by the previous commit', reports --- local.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/local.sh b/local.sh index 6e9ce89..9ec12f5 100755 --- a/local.sh +++ b/local.sh @@ -158,16 +158,20 @@ EOF rm -rf reports echo "Deploy Locust application locally" + + if $AUTOMATIC; then + ABORT_ON_EXIT="--abort-on-container-exit" + else + echo "Getting the Locust application ready on http://:8089" + fi + (export IMAGE=$IMAGE && export TARGET_HOST=$TARGET && export LOCUST_FILE=$LOCUST_FILE && export SLAVE_NUM=$SLAVES && export AUTOMATIC=$AUTOMATIC && export USERS=$USERS && export HATCH_RATE=$HATCH_RATE && export DURATION=$DURATION && export OAUTH=$OAUTH && URL=$URL && export SEND_ANONYMOUS_USAGE_INFO=$KPI && - export SCOPES=$SCOPES && export BUILD_URL=$BUILD_URL && docker-compose up --abort-on-container-exit) + export SCOPES=$SCOPES && export BUILD_URL=$BUILD_URL && docker-compose up $ABORT_ON_EXIT) if $AUTOMATIC; then - sleep $DURATION docker cp docker_locusts_controller:/opt/reports . - else - echo "Locust application is successfully deployed. you can access http://:8089" fi else From fdff09f9b33c845edbc7dc013d93334b29277711 Mon Sep 17 00:00:00 2001 From: scherniavsky Date: Thu, 14 Jun 2018 13:41:04 +0200 Subject: [PATCH 3/3] wording change --- local.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local.sh b/local.sh index 9ec12f5..cd70e7b 100755 --- a/local.sh +++ b/local.sh @@ -162,7 +162,7 @@ EOF if $AUTOMATIC; then ABORT_ON_EXIT="--abort-on-container-exit" else - echo "Getting the Locust application ready on http://:8089" + echo "Locust will be available on http://:8089" fi (export IMAGE=$IMAGE && export TARGET_HOST=$TARGET && export LOCUST_FILE=$LOCUST_FILE && export SLAVE_NUM=$SLAVES &&