Skip to content

Commit

Permalink
Merge pull request #310 from levoai/bbr/umesh/testrunner
Browse files Browse the repository at this point in the history
Adding .env file and updated docs
  • Loading branch information
umeshreddy21 authored Jan 23, 2025
2 parents 586d7d7 + da4a57d commit 167af41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/security-testing/testrunner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ If Docker is installed on your machine, follow these steps to start the testrunn
chmod +x levoai-testrunner.sh
```

3. Set the required environment variables:
```bash
export LEVOAI_AUTH_KEY='<your-auth-key>'
export LEVOAI_ORG_ID='<your-organization-id>'
3. Create .env file in the same directory to set the required environment variables:
```
LEVOAI_AUTH_KEY='<your-auth-key>'
LEVOAI_ORG_ID='<your-organization-id>'
```

4. Start the testrunner:
Expand Down
11 changes: 9 additions & 2 deletions static/artifacts/testrunner/levoai-testrunner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ CONTAINER_NAME="levoai-testrunner"
IMAGE_NAME="levoai/levo:stable"
DEFAULT_LEVOAI_BASE_URL="https://api.levo.ai"

# Load environment variables from .env file
if [ -f .env ]; then
export $(cat .env | grep -v '#' | awk '/=/ {print $1}')
else
echo "Error: .env file not found."
exit 1
fi

# Function to display usage information
show_usage() {
echo "Usage: $0 [start|stop]"
Expand Down Expand Up @@ -47,8 +55,7 @@ check_env_var() {
local var_value="${!var_name}"
if [[ -z "$var_value" ]]; then
echo "Error: Environment variable $var_name is not set."
echo "Try setting the $var_name using the following command:"
echo "export $var_name='value'"
echo "Try setting the $var_name in the .env file."
exit 1
fi
}
Expand Down

0 comments on commit 167af41

Please sign in to comment.