feat: improve local dev with install path (#1221)

- 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
This commit is contained in:
Eli Bosley
2025-03-17 09:44:10 -04:00
committed by GitHub
parent 1b0fbaf81a
commit ce61fee41c
20 changed files with 533 additions and 108 deletions

View File

@@ -17,4 +17,15 @@ fi
CI=${CI:-false}
TAG="LOCAL_PLUGIN_BUILD"
docker compose run --service-ports --rm -e HOST_LAN_IP="$HOST_LAN_IP" -e CI="$CI" -e TAG="$TAG" plugin-builder "$@"
# 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} "$@"

View File

@@ -1,30 +1,18 @@
#!/bin/bash
# Arguments
# $1: SSH server name
# $1: SSH server name (required)
# $2: {--wc-deploy|--wc-build|--wc-skip} / deploy or build web components w/o prompt
# Path to store the last used server name
state_file="$HOME/.deploy_state"
# Read the last used server name from the state file
if [[ -f "$state_file" ]]; then
last_server_name=$(cat "$state_file")
else
last_server_name=""
fi
# Read the server name from the command-line argument or use the last used server name as the default
server_name="${1:-$last_server_name}"
# Check if the server name is provided
if [[ -z "$server_name" ]]; then
echo "Please provide the SSH server name."
if [[ -z "$1" ]]; then
echo "Error: SSH server name is required."
echo "Usage: $0 <server_name> [--wc-deploy|--wc-build|--wc-skip]"
exit 1
fi
# Save the current server name to the state file
echo "$server_name" > "$state_file"
# Set server name from command-line argument
server_name="$1"
# Source directory path
source_directory="plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins"

View File

@@ -3,7 +3,7 @@
mkdir -p /app/deploy/
# Start http-server with common fileserver settings
http-server /app/deploy/ \
--port 8080 \
--port 5858 \
--host 0.0.0.0 \
--cors \
--gzip \

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Use ANSI escape codes for color and formatting
# \e[1m = bold, \e[32m = green, \e[0m = reset formatting
echo -e "\e[1m\e[32m"
echo "=============================================================="
echo " INSTALL THE LOCAL PLUGIN USING THIS URL: "
echo " http://${HOST_LAN_IP}:5858/dynamix.unraid.net.plg "
echo "=============================================================="
echo -e "\e[0m"