30 lines
806 B
Bash
Executable File
30 lines
806 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
SOURCE_BINARY="$SCRIPT_DIR/didactyl_static_x86_64"
|
|
REMOTE_TARGET="ubuntu@laantungir.net:~/didactyl"
|
|
|
|
if ! command -v rsync >/dev/null 2>&1; then
|
|
echo "ERROR: rsync is not installed or not in PATH"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f "$SOURCE_BINARY" ]; then
|
|
echo "ERROR: Source binary not found: $SOURCE_BINARY"
|
|
echo "Build it first so didactyl_static_x86_64 exists."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building static binary first..."
|
|
"$SCRIPT_DIR/build_static.sh"
|
|
|
|
if [ ! -f "$SOURCE_BINARY" ]; then
|
|
echo "ERROR: Build completed but source binary not found: $SOURCE_BINARY"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Deploying $SOURCE_BINARY to $REMOTE_TARGET"
|
|
rsync -avz --progress "$SOURCE_BINARY" "$REMOTE_TARGET"
|
|
echo "Deployment complete." |