migration reorg basically done
This commit is contained in:
@@ -95,10 +95,15 @@ for pack_dir in "$SOURCE_PACKS_DIR"/*; do
|
||||
target_pack_dir="$TARGET_PACKS_DIR/$pack_name"
|
||||
|
||||
if [ -d "$target_pack_dir" ]; then
|
||||
# Pack exists, check if we should update
|
||||
# For now, we'll skip if it exists (idempotent on restart)
|
||||
echo -e "${YELLOW} ⊘${NC} Pack already exists at: $target_pack_dir"
|
||||
echo -e "${BLUE} ℹ${NC} Skipping copy (use fresh volume to reload)"
|
||||
# Pack exists, update files to ensure we have latest (especially binaries)
|
||||
echo -e "${YELLOW} ⟳${NC} Pack exists at: $target_pack_dir, updating files..."
|
||||
cp -rf "$pack_dir"/* "$target_pack_dir"/
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN} ✓${NC} Updated pack files at: $target_pack_dir"
|
||||
else
|
||||
echo -e "${RED} ✗${NC} Failed to update pack"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Copy pack to target directory
|
||||
echo -e "${YELLOW} →${NC} Copying pack files..."
|
||||
|
||||
48
docker/sensor-entrypoint.sh
Normal file
48
docker/sensor-entrypoint.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
# Sensor service entrypoint script
|
||||
# Copies sensor binary from image to shared volume on startup
|
||||
|
||||
set -e
|
||||
|
||||
echo "Sensor entrypoint: Checking for sensor binary..."
|
||||
|
||||
# Path to sensor binary in the image (baked in during build)
|
||||
BINARY_IN_IMAGE="/opt/attune/packs-image/core/sensors/attune-core-timer-sensor"
|
||||
|
||||
# Destination in the shared volume
|
||||
BINARY_DEST="/opt/attune/packs/core/sensors/attune-core-timer-sensor"
|
||||
|
||||
# Create sensors directory if it doesn't exist
|
||||
mkdir -p "/opt/attune/packs/core/sensors"
|
||||
|
||||
# Check if we have a binary to copy from a different location in the image
|
||||
# The Dockerfile copies the binary, but it gets hidden by the volume mount
|
||||
# So we need to copy it from the image layer to the mounted volume
|
||||
|
||||
# Try to find the binary from docker build
|
||||
if [ -f "$BINARY_IN_IMAGE" ]; then
|
||||
echo "Copying sensor binary from $BINARY_IN_IMAGE to $BINARY_DEST"
|
||||
cp -f "$BINARY_IN_IMAGE" "$BINARY_DEST"
|
||||
chmod +x "$BINARY_DEST"
|
||||
echo "✓ Sensor binary updated in shared volume"
|
||||
elif [ ! -f "$BINARY_DEST" ]; then
|
||||
echo "ERROR: Sensor binary not found in image and not present in volume"
|
||||
echo "Expected at: $BINARY_IN_IMAGE or $BINARY_DEST"
|
||||
exit 1
|
||||
else
|
||||
echo "Using existing sensor binary in shared volume: $BINARY_DEST"
|
||||
fi
|
||||
|
||||
# Verify binary exists and is executable
|
||||
if [ -f "$BINARY_DEST" ] && [ -x "$BINARY_DEST" ]; then
|
||||
echo "✓ Sensor binary ready: $BINARY_DEST"
|
||||
ls -lh "$BINARY_DEST"
|
||||
else
|
||||
echo "ERROR: Sensor binary not executable or not found: $BINARY_DEST"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting Attune Sensor Service..."
|
||||
|
||||
# Execute the main service
|
||||
exec /usr/local/bin/attune-service "$@"
|
||||
Reference in New Issue
Block a user