gatling-sample-framework/docker/docker-run.ps1

12 lines
658 B
PowerShell

param ($test, $user, $pswd, $count, $ramp_in_minutes, $duration_in_minutes)
$env:BASE_URL="subdomain.organization.com"
$env:DOCKER_IMAGE="gatling-load-test"
$env:DOCKER_CONTAINER="gatling_load_test"
docker rm ${DOCKER_CONTAINER}
docker build -t ${DOCKER_IMAGE}:1.0 .
docker run -e TEST="$test" -e TEST_USER="$user" -e TEST_PWD="$pswd" -e BASE_URL=$env:BASE_URL -e USER_COUNT="$count" -e RAMP_DURATION="$ramp_in_minutes" -e TEST_DURATION="$duration_in_minutes" --name ${DOCKER_CONTAINER} -p 8000:8000 ${DOCKER_IMAGE}:1.0
$cid = docker ps --no-trunc -aqf name=${DOCKER_CONTAINER}
docker cp ${cid}:/build/test_report_"${test}"_"${cid}".zip .\out\