use battlsnake cli from git repo and build client localy
This commit is contained in:
+3
-1
@@ -7,5 +7,7 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
data/
|
data/
|
||||||
.env
|
.env
|
||||||
|
.tools/
|
||||||
|
|
||||||
dbschema/migrations/
|
dbschema/migrations/
|
||||||
*.jsonl
|
*.jsonl
|
||||||
@@ -12,6 +12,9 @@ set dotenv-required := true
|
|||||||
# Use zsh
|
# Use zsh
|
||||||
set shell := ["bash", "-cu"]
|
set shell := ["bash", "-cu"]
|
||||||
|
|
||||||
|
BATTLESNAKE_CLI_DIR := ".tools/battlesnake-cli"
|
||||||
|
BATTLESNAKE_CLI_BIN := ".tools/battlesnake-cli/battlesnake"
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Default
|
# Default
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@@ -28,23 +31,50 @@ default:
|
|||||||
run:
|
run:
|
||||||
"{{justfile_directory()}}/main.py"
|
"{{justfile_directory()}}/main.py"
|
||||||
|
|
||||||
|
build-battlesnake-cli:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
install_dir="{{justfile_directory()}}/{{BATTLESNAKE_CLI_DIR}}"
|
||||||
|
bin_path="{{justfile_directory()}}/{{BATTLESNAKE_CLI_BIN}}"
|
||||||
|
mkdir -p "$install_dir"
|
||||||
|
|
||||||
|
if [ ! -f "{{justfile_directory()}}/local-client/go.mod" ]; then
|
||||||
|
echo "Missing local-client source. Run: git submodule update --init --recursive"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "{{justfile_directory()}}/local-client"
|
||||||
|
go build -o "$bin_path" ./cli/battlesnake/main.go
|
||||||
|
)
|
||||||
|
|
||||||
|
"$bin_path" --help > /dev/null
|
||||||
|
echo "Built Battlesnake CLI at $bin_path"
|
||||||
|
|
||||||
|
battlesnake-cli-version:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
"{{justfile_directory()}}/{{BATTLESNAKE_CLI_BIN}}" --help
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Testing helpers
|
# Testing helpers
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
test-constrictor:
|
test-constrictor: build-battlesnake-cli
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BATTLESNAKE_CLI=battlesnake_cli_1.2.3_Linux_x86_64/battlesnake
|
BATTLESNAKE_CLI="{{justfile_directory()}}/{{BATTLESNAKE_CLI_BIN}}"
|
||||||
$BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g constrictor --browser --minimumFood 0
|
"$BATTLESNAKE_CLI" play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g constrictor --browser --minimumFood 0
|
||||||
|
|
||||||
test-seed:
|
test-seed: build-battlesnake-cli
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BATTLESNAKE_CLI=battlesnake_cli_1.2.3_Linux_x86_64/battlesnake
|
BATTLESNAKE_CLI="{{justfile_directory()}}/{{BATTLESNAKE_CLI_BIN}}"
|
||||||
$BATTLESNAKE_CLI play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g solo --browser --seed 1713099635738952360
|
"$BATTLESNAKE_CLI" play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g solo --browser --seed 1713099635738952360
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Fataset helpers
|
# Fataset helpers
|
||||||
|
|||||||
Reference in New Issue
Block a user