deploy.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # Deploy script for ImageDrop demo
  3. # Copies the built files to a project's public folder
  4. # Configuration - set PROJECT_PUBLIC_DIR or pass as argument
  5. PROJECT_PUBLIC_DIR="${1:-$PROJECT_PUBLIC_DIR}"
  6. if [ -z "$PROJECT_PUBLIC_DIR" ]; then
  7. echo "Usage: ./deploy.sh <project-public-dir>"
  8. echo " or: PROJECT_PUBLIC_DIR=/path/to/project/public ./deploy.sh"
  9. echo ""
  10. echo "Example:"
  11. echo " ./deploy.sh /data/daas/data/projects/my-project/public"
  12. echo ""
  13. echo "This will copy the built files from ./dist to the specified directory."
  14. exit 1
  15. fi
  16. # Check if dist folder exists
  17. if [ ! -d "dist" ]; then
  18. echo "Error: dist folder not found. Run 'npm run build' first."
  19. exit 1
  20. fi
  21. # Create target directory if it doesn't exist
  22. mkdir -p "$PROJECT_PUBLIC_DIR"
  23. # Copy files
  24. echo "Deploying to: $PROJECT_PUBLIC_DIR"
  25. cp -r dist/* "$PROJECT_PUBLIC_DIR/"
  26. echo "Deployment complete!"
  27. echo ""
  28. echo "Files deployed:"
  29. ls -la "$PROJECT_PUBLIC_DIR/"
  30. echo ""
  31. echo "The demo is now accessible at your project's domain."
  32. echo "Routes: /#/, /#/login, /#/register, /#/dashboard"