-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
49 lines (45 loc) · 1.94 KB
/
Copy pathstart.sh
File metadata and controls
49 lines (45 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Let's Play AdCP: one command that starts the whole session.
# Call from the extracted folder: bash start.sh
set -euo pipefail
cd "$(dirname "$0")"
# Fetch the sales agent on first run. Pinned SHA lives in pyproject.toml
# under [tool.adcp_hands_on.sandbox]; bump it there when re-verifying.
if [ ! -d sandbox/salesagent ]; then
SANDBOX_SHA="$(awk '
/^\[tool\.adcp_hands_on\.sandbox\]$/ { in_section=1; next }
/^\[/ { in_section=0 }
in_section && /^sha =/ {
gsub(/"/, "", $3)
print $3
exit
}
' pyproject.toml)"
if [ -z "$SANDBOX_SHA" ]; then
echo "ERROR: could not read sandbox SHA from pyproject.toml" >&2
exit 1
fi
echo "==> First run: fetching prebid/salesagent at ${SANDBOX_SHA} ..."
git init sandbox/salesagent
git -C sandbox/salesagent remote add origin https://github.com/prebid/salesagent.git
git -C sandbox/salesagent fetch --depth 1 origin "$SANDBOX_SHA"
git -C sandbox/salesagent checkout --detach FETCH_HEAD
cp sandbox/salesagent/.env.template sandbox/salesagent/.env
# CREATE_DEMO_TENANT seeds a Default Publisher with the mock adapter.
# ADCP_TESTING makes the test-token auth header valid for create_media_buy.
if grep -q '^CREATE_DEMO_TENANT=' sandbox/salesagent/.env; then
sed -i.bak 's/^CREATE_DEMO_TENANT=.*/CREATE_DEMO_TENANT=true/' sandbox/salesagent/.env
else
echo 'CREATE_DEMO_TENANT=true' >> sandbox/salesagent/.env
fi
if grep -q '^ADCP_TESTING=' sandbox/salesagent/.env; then
sed -i.bak 's/^ADCP_TESTING=.*/ADCP_TESTING=true/' sandbox/salesagent/.env
else
echo 'ADCP_TESTING=true' >> sandbox/salesagent/.env
fi
fi
echo "==> Bringing up the sales agent (Docker) ..."
( cd sandbox/salesagent && docker compose up -d )
echo "==> Starting Claude Code ..."
exec claude --permission-mode auto \
"Read START_HERE.md and execute it. Begin immediately with Phase 0, then top to bottom until the end. No selection menu, no clarifying questions."