Add client download link and build tarball during deployment

- Added /download/client endpoint to serve the CLI client tarball
- Added "Client" link to navigation in base template
- Created build-client.sh script to clone and package the client
- Updated Dockerfile to run build-client.sh during container build

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-11 19:08:55 +00:00
parent 0ddeb5ba94
commit ab2f65e14d
4 changed files with 59 additions and 2 deletions

37
build-client.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Build the artdag-client tarball
# This script is run during deployment to create the downloadable client package
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLIENT_REPO="https://git.rose-ash.com/art-dag/client.git"
TEMP_DIR=$(mktemp -d)
OUTPUT_FILE="$SCRIPT_DIR/artdag-client.tar.gz"
echo "Building artdag-client.tar.gz..."
# Clone the client repo
git clone --depth 1 "$CLIENT_REPO" "$TEMP_DIR/artdag-client" 2>/dev/null || {
echo "Failed to clone client repo, trying alternative..."
# Try GitHub if internal git fails
git clone --depth 1 "https://github.com/gilesbradshaw/art-client.git" "$TEMP_DIR/artdag-client" 2>/dev/null || {
echo "Error: Could not clone client repository"
rm -rf "$TEMP_DIR"
exit 1
}
}
# Remove .git directory
rm -rf "$TEMP_DIR/artdag-client/.git"
rm -rf "$TEMP_DIR/artdag-client/__pycache__"
# Create tarball
cd "$TEMP_DIR"
tar -czf "$OUTPUT_FILE" artdag-client
# Cleanup
rm -rf "$TEMP_DIR"
echo "Created: $OUTPUT_FILE"
ls -lh "$OUTPUT_FILE"