Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/bin/bash
2
3# Wrapper script to build SpiderLily on Mac from dev container
4# Loads credentials from vault and executes build remotely
5#
6# Usage:
7# ./build-spiderlily-from-devcontainer.sh # Normal build with P4 sync
8# ./build-spiderlily-from-devcontainer.sh --no-sync # Build using local files (no sync)
9
10set -e
11
12SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
13VAULT_DIR="$SCRIPT_DIR/../aesthetic-computer-vault"
14
15# Parse arguments
16EXTRA_ARGS=""
17for arg in "$@"; do
18 case $arg in
19 --no-sync|--skip-sync)
20 EXTRA_ARGS="$EXTRA_ARGS --no-sync"
21 ;;
22 esac
23done
24
25# Load Mac credentials
26if [ -f "$VAULT_DIR/false.work/mac-builder-credentials.env" ]; then
27 source "$VAULT_DIR/false.work/mac-builder-credentials.env"
28else
29 echo "ERROR: Credentials not found at $VAULT_DIR/false.work/mac-builder-credentials.env"
30 exit 1
31fi
32
33echo "========================================="
34echo "SpiderLily Remote Build (Dev Container → Mac)"
35echo "========================================="
36echo "Connecting to: $MAC_USERNAME@$MAC_HOST"
37echo ""
38
39# Check if sshpass is available
40if ! command -v sshpass &> /dev/null; then
41 echo "Installing sshpass..."
42 sudo dnf install -y sshpass
43fi
44
45# Copy the build script to Mac
46echo "📤 Uploading build script..."
47sshpass -p "$MAC_PASSWORD" scp \
48 "$SCRIPT_DIR/build-run-spiderlily.sh" \
49 "$MAC_USERNAME@$MAC_HOST:~/build-run-spiderlily.sh"
50
51# Make it executable and run it
52echo "🚀 Starting build on Mac..."
53echo ""
54sshpass -p "$MAC_PASSWORD" ssh \
55 "$MAC_USERNAME@$MAC_HOST" \
56 "chmod +x ~/build-run-spiderlily.sh && ~/build-run-spiderlily.sh $EXTRA_ARGS"