38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/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"
|