Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update action.sh #8

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion action.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

set -e
if [[ -n "${INPUT_BASE_URL_OVERRIDE}" ]]; then

if [[ -n "${INPUT_BASE_URL_OVERRIDE}" ]]; then
echo "initial-base-url=$(grep "BASE_URL" ${INPUT_K6_SCRIPT} | head -1)" >> $GITHUB_OUTPUT
sed -i "s,const BASE_URL =.*,const BASE_URL = \"${INPUT_BASE_URL_OVERRIDE}\";,g" $INPUT_K6_SCRIPT
echo "resulting-base-url=$(grep "BASE_URL" ${INPUT_K6_SCRIPT} | head -1)" >> $GITHUB_OUTPUT
Expand All @@ -12,6 +13,7 @@ sleep 60
echo "Starting K6 tests."

acct=$(aws sts get-caller-identity --query 'Account' --output text)
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${acct}.dkr.ecr.us-east-1.amazonaws.com

if [[ -n "${INPUT_ADDITIONAL_MOUNT}" ]]; then
docker run -v $(pwd)/${INPUT_K6_SCRIPT}:/k6/${INPUT_K6_SCRIPT} -v $(pwd)/${INPUT_ADDITIONAL_MOUNT}:/k6/${INPUT_ADDITIONAL_MOUNT} ${acct}.dkr.ecr.us-east-1.amazonaws.com/docker-hub/grafana/k6:latest run ${INPUT_K6_FLAGS} /k6/${INPUT_K6_SCRIPT}
Expand Down
Loading