Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Merge branch 'docker-image-test' of github.com:tortila/docker-locust …
Browse files Browse the repository at this point in the history
…into docker-image-test
  • Loading branch information
tortila committed Jun 14, 2018
2 parents ef9ff1b + 0b34655 commit dde240f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,27 @@ EOF
rm -rf reports

echo "Deploy Locust application locally"

if $AUTOMATIC; then
ABORT_ON_EXIT="--abort-on-container-exit"
else
echo "Locust will be available on http://<docker-host-ip-address>: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)

echo "Locust application is successfully deployed. you can access http://<docker-host-ip-address>:8089"
export SCOPES=$SCOPES && export BUILD_URL=$BUILD_URL && docker-compose up $ABORT_ON_EXIT)

if $AUTOMATIC; then
sleep 8
sleep $DURATION
docker cp docker_locusts_controller:/opt/reports .
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 \
Expand Down

0 comments on commit dde240f

Please sign in to comment.