Reorganize project structure: move docs and scripts to proper directories
Changes:
- Created scripts/ directory for build and utility scripts
- Moved build-for-airgap.sh to scripts/
- Moved check-ready.sh to scripts/
- Kept quickstart scripts in root for easy access
- Moved HELM-DEPLOYMENT.md to docs/
Updated references:
- README.md: Updated link to docs/HELM-DEPLOYMENT.md
- docs/DEPLOYMENT.md: Updated paths to scripts/build-for-airgap.sh
- quickstart-airgap.sh: Updated path to scripts/build-for-airgap.sh
- scripts/check-ready.sh: Updated self-reference path
- helm/warehouse13/QUICKSTART.md: Updated HELM-DEPLOYMENT.md path
- helm/README.md: Updated HELM-DEPLOYMENT.md path
Directory structure now:
/
├── README.md (root)
├── quickstart.sh (root - easy access)
├── quickstart-airgap.sh (root - easy access)
├── docs/ (all documentation)
│ ├── API.md
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ ├── FEATURES.md
│ ├── FRONTEND_SETUP.md
│ ├── HELM-DEPLOYMENT.md (moved here)
│ └── SUMMARY.md
├── scripts/ (build and utility scripts)
│ ├── build-for-airgap.sh (moved here)
│ └── check-ready.sh (moved here)
└── helm/
└── warehouse13/ (Helm chart with docs)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
70
scripts/build-for-airgap.sh
Normal file
70
scripts/build-for-airgap.sh
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "========================================="
|
||||
echo "Building Angular for Air-Gapped Deployment"
|
||||
echo "========================================="
|
||||
echo ""
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [ ! -f "docker-compose.yml" ]; then
|
||||
echo "Error: Must run from project root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if node is installed
|
||||
if ! command -v node &> /dev/null; then
|
||||
echo "Error: Node.js is not installed. Please install Node.js 24+ first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if npm is installed
|
||||
if ! command -v npm &> /dev/null; then
|
||||
echo "Error: npm is not installed. Please install npm first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Step 1/3: Installing dependencies..."
|
||||
cd frontend
|
||||
npm install
|
||||
|
||||
echo ""
|
||||
echo "Step 2/3: Building Angular production bundle..."
|
||||
npm run build:prod
|
||||
|
||||
echo ""
|
||||
echo "Step 3/3: Copying to static directory..."
|
||||
if [ -d "dist/frontend/browser" ]; then
|
||||
echo "✓ Build successful!"
|
||||
echo "✓ Output: frontend/dist/frontend/browser"
|
||||
|
||||
# Copy to static directory for local FastAPI serving
|
||||
cd ..
|
||||
rm -rf static/*
|
||||
cp -r frontend/dist/frontend/browser/* static/
|
||||
echo "✓ Copied to static/ directory"
|
||||
|
||||
ls -lh static/ | head -10
|
||||
else
|
||||
echo "✗ Build failed - output directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "========================================="
|
||||
echo "Build Complete!"
|
||||
echo "========================================="
|
||||
echo ""
|
||||
echo "The Angular app has been built and copied to static/"
|
||||
echo "You can now:"
|
||||
echo ""
|
||||
echo "1. Run locally with FastAPI:"
|
||||
echo " uvicorn app.main:app --reload"
|
||||
echo " Access at: http://localhost:8000"
|
||||
echo ""
|
||||
echo "2. Deploy with Docker:"
|
||||
echo " docker-compose up -d --build"
|
||||
echo " (Docker will rebuild Angular during build)"
|
||||
echo ""
|
||||
echo "========================================="
|
||||
62
scripts/check-ready.sh
Executable file
62
scripts/check-ready.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "========================================="
|
||||
echo "Warehouse13 - Readiness Check"
|
||||
echo "========================================="
|
||||
echo ""
|
||||
|
||||
errors=0
|
||||
|
||||
# Check if pre-built files exist
|
||||
if [ -d "frontend/dist/frontend/browser" ]; then
|
||||
echo "✓ Pre-built Angular files found"
|
||||
echo " Location: frontend/dist/frontend/browser"
|
||||
file_count=$(ls -1 frontend/dist/frontend/browser | wc -l)
|
||||
echo " Files: $file_count"
|
||||
else
|
||||
echo "✗ ERROR: Pre-built Angular files NOT found!"
|
||||
echo " Expected: frontend/dist/frontend/browser"
|
||||
echo ""
|
||||
echo " You need to build the Angular app first:"
|
||||
echo " Run: ./scripts/build-for-airgap.sh"
|
||||
echo " OR: cd frontend && npm install && npm run build:prod"
|
||||
echo ""
|
||||
errors=$((errors + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Check if docker-compose.yml is configured for pre-built
|
||||
if grep -q "Dockerfile.frontend.prebuilt" docker-compose.yml; then
|
||||
echo "✓ docker-compose.yml configured for pre-built deployment"
|
||||
else
|
||||
echo "⚠ WARNING: docker-compose.yml may not be configured for pre-built deployment"
|
||||
echo " Current frontend dockerfile:"
|
||||
grep "dockerfile:" docker-compose.yml | grep -A 1 "frontend:" | tail -1
|
||||
echo ""
|
||||
echo " For air-gapped deployment, it should be: Dockerfile.frontend.prebuilt"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Check if Docker is running
|
||||
if docker info &> /dev/null; then
|
||||
echo "✓ Docker is running"
|
||||
else
|
||||
echo "✗ ERROR: Docker is not running or not accessible"
|
||||
errors=$((errors + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "========================================="
|
||||
|
||||
if [ $errors -eq 0 ]; then
|
||||
echo "✓ Ready to deploy!"
|
||||
echo ""
|
||||
echo "Run: docker-compose up -d --build"
|
||||
echo "Or: ./quickstart-airgap.sh"
|
||||
exit 0
|
||||
else
|
||||
echo "✗ NOT ready - please fix the errors above"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user