mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
- also add better watcher support <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a helper that displays a local installation URL to simplify setting up the plugin. - **Chores** - Updated service and container port configurations to ensure consistent network connectivity (changed from 8080 to 5858). - Refined container management to gracefully handle running instances during startup. - Improved build and installation routines for streamlined deployment and enhanced reliability. - Enhanced documentation to clarify installation and usage instructions for better user experience. - Introduced a new document outlining development workflows for better guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1209561202532053
32 lines
1.0 KiB
Bash
Executable File
32 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Get host IP based on platform
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
# macOS
|
|
HOST_LAN_IP=$(ipconfig getifaddr en0 || ipconfig getifaddr en1 || echo "127.0.0.1")
|
|
else
|
|
# Linux and others
|
|
HOST_LAN_IP=$(hostname -I | awk '{print $1}' || echo "127.0.0.1")
|
|
fi
|
|
|
|
# Verify we have a valid IP
|
|
if [[ ! $HOST_LAN_IP =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Error: Could not determine valid host IP address. Using localhost."
|
|
HOST_LAN_IP="127.0.0.1"
|
|
fi
|
|
|
|
CI=${CI:-false}
|
|
TAG="LOCAL_PLUGIN_BUILD"
|
|
|
|
# Define container name for easier management
|
|
CONTAINER_NAME="plugin-builder"
|
|
|
|
# Stop any running plugin-builder container first
|
|
echo "Stopping any running plugin-builder containers..."
|
|
docker ps -q --filter "name=${CONTAINER_NAME}" | xargs -r docker stop
|
|
|
|
# Start the container with the specified environment variables
|
|
echo "Starting plugin-builder container..."
|
|
|
|
docker compose run --remove-orphans --service-ports -e HOST_LAN_IP="$HOST_LAN_IP" -e CI="$CI" -e TAG="$TAG" ${CONTAINER_NAME} "$@"
|