# Zoho CRM API - Runtime Build
# This justfile is responsible for preparing the Lambda runtime for the Zoho CRM API
import '../common.justfile'
api_dir := justfile_directory()
# Build the runtime for this API package
# This recipe is called by the root justfile during the Docker build process
build-runtime output_dir:
just build-api-runtime \
"Zoho CRM API" \
https://raw.githubusercontent.com/zoho/crm-oas/refs/heads/main/v8.0/record.json \
{{api_dir}} \
"{{output_dir}}"
# Run smoke tests with OAuth credentials from environment
# If no stack_name provided, tests run locally (uses .env file for MCP_SERVER_URL)
smoke-test stack_name="":
#!/usr/bin/env bash
set -e
# Get repository root (api_dir is at packages/apis/zoho-crm)
REPO_ROOT="$(cd "{{api_dir}}/../.." && pwd)"
if [ -z "{{stack_name}}" ]; then
echo "🧪 Running Zoho CRM smoke tests locally..."
cd "$REPO_ROOT" && python -m pytest {{api_dir}}/test_zoho_mcp.py -v -s
else
echo "🧪 Running Zoho CRM smoke tests for stack: {{stack_name}}..."
# Get API URL from CloudFormation stack
API_URL=$(aws cloudformation describe-stacks \
--stack-name "{{stack_name}}" \
--query 'Stacks[0].Outputs[?contains(OutputKey, `ApiUrl`)].OutputValue | [0]' \
--output text)
if [ -z "$API_URL" ]; then
echo "❌ Error: Could not find API URL in stack {{stack_name}}"
exit 1
fi
echo "🌐 Testing API at: $API_URL"
cd "$REPO_ROOT" && MCP_SERVER_URL="$API_URL" \
python -m pytest {{api_dir}}/test_zoho_mcp.py -v -s
fi