Refactor Dockerfile for scraper, update Traefik configuration, and clean up scripts
- Simplified Dockerfile for scraper by removing unnecessary Node.js installation and optimizing build stages. - Updated Traefik environment configuration to use shorter variable names for certificate paths. - Removed commented-out middleware configurations in dynamic middlewares.yaml. - Cleaned up legacy SSL configurations in ssl.yaml. - Disabled insecure API access in Traefik configuration. - Deleted unused renovate.json file. - Modified update environment script to only process apps directory. - Updated GHCR cleanup script to target specific package. - Streamlined dependency update script to focus on app submodules. - Removed setup script for Prometheus as it is no longer needed.
This commit is contained in:
+10
-58
@@ -1,65 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Define an array of directories to aggressively prune from the search tree
|
||||
# This prevents exhaustive traversal into massive localized dependency stores, build caches,
|
||||
# and anomalously created cache directories (e.g., literal '~').
|
||||
PRUNE_DIRS=(
|
||||
"node_modules"
|
||||
"dist"
|
||||
".next"
|
||||
".bun"
|
||||
"~"
|
||||
"build"
|
||||
".git"
|
||||
"target"
|
||||
)
|
||||
echo "=== Updating root dependencies ==="
|
||||
bun update
|
||||
|
||||
# Construct the prune expression dynamically to feed the find command
|
||||
PRUNE_ARGS=()
|
||||
for dir in "${PRUNE_DIRS[@]}"; do
|
||||
if [ ${#PRUNE_ARGS[@]} -gt 0 ]; then
|
||||
PRUNE_ARGS+=("-o")
|
||||
echo ""
|
||||
echo "=== Updating app submodule dependencies ==="
|
||||
for app in apps/*/; do
|
||||
if [ -f "${app}package.json" ]; then
|
||||
echo "→ $app"
|
||||
(cd "$app" && bun update 2>/dev/null && echo " ✓ $app updated") || echo " - skipping $app (no bun setup)"
|
||||
fi
|
||||
PRUNE_ARGS+=("-name" "$dir")
|
||||
done
|
||||
|
||||
echo "Scanning for top-level and workspace package.json manifests..."
|
||||
|
||||
# Perform an optimized find:
|
||||
# 1. -prune halts traversal immediately upon matching a PRUNE_DIR, achieving extreme I/O efficiency.
|
||||
# 2. -print0 strictly streams zero-byte delimited paths, immunizing the loop against spaces/newlines.
|
||||
find . \( "${PRUNE_ARGS[@]}" \) -prune -o -name "package.json" -type f -print0 | while IFS= read -r -d '' filename; do
|
||||
dir=$(dirname "$filename")
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Initiating strict dependency update sequence in: $dir"
|
||||
|
||||
# Spawn a tightly scoped subshell. This isolates environment state and traps internal pathing failures.
|
||||
(
|
||||
# Strict directory entry checks.
|
||||
cd "$dir" || {
|
||||
echo "CRITICAL: Directory transition failed for $dir. Process aborted." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Heuristic check: Ensure the manifest actually declares dependencies before thrashing the disk with ncu.
|
||||
if ! grep -Eq '"(dependencies|devDependencies|peerDependencies)"[[:space:]]*:' package.json; then
|
||||
echo "Notice: No valid dependency blocks detected in $dir/package.json. Bypassing node traversal."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Delegate command resolution to bunx. This obliterates the 'command not found' failure mode
|
||||
# by dynamically sourcing the npm-check-updates binary, completely ignoring global namespace pollution.
|
||||
echo "Executing constraint-free updates via bunx..."
|
||||
bunx --bun npm-check-updates -u
|
||||
|
||||
echo "Commencing rigorous package installation phase..."
|
||||
bun install
|
||||
) || {
|
||||
echo "WARNING: Subshell failure encountered in $dir. Subsystem continues." >&2
|
||||
}
|
||||
done
|
||||
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "SYSTEM STATE: All traversable dependencies aggressively updated."
|
||||
echo ""
|
||||
echo "✅ All dependencies updated"
|
||||
|
||||
Reference in New Issue
Block a user