75 lines
2.2 KiB
Bash
75 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Password Generator Package Creator
|
|
# Creates a distributable archive of the complete i18n-enabled password generator
|
|
|
|
echo "📦 Creating Password Generator Distribution Package"
|
|
echo "================================================="
|
|
|
|
# Get version from environment or use default
|
|
VERSION=${1:-"2.0.0-i18n"}
|
|
PACKAGE_NAME="password-generator-${VERSION}"
|
|
|
|
# Create temporary directory structure
|
|
echo "📁 Preparing package structure..."
|
|
rm -rf dist/
|
|
mkdir -p dist/${PACKAGE_NAME}
|
|
|
|
# Copy all necessary files
|
|
cp -r config/ dist/${PACKAGE_NAME}/
|
|
cp -r src/ dist/${PACKAGE_NAME}/
|
|
cp -r templates/ dist/${PACKAGE_NAME}/
|
|
cp -r assets/ dist/${PACKAGE_NAME}/
|
|
cp -r locales/ dist/${PACKAGE_NAME}/
|
|
cp -r public/ dist/${PACKAGE_NAME}/
|
|
|
|
# Copy configuration and documentation
|
|
cp composer.json dist/${PACKAGE_NAME}/
|
|
cp .env dist/${PACKAGE_NAME}/.env.example
|
|
cp README.md dist/${PACKAGE_NAME}/
|
|
cp DEPLOYMENT.md dist/${PACKAGE_NAME}/
|
|
cp install.sh dist/${PACKAGE_NAME}/
|
|
|
|
# Create logs directory with placeholder
|
|
mkdir -p dist/${PACKAGE_NAME}/logs
|
|
cp logs/README.md dist/${PACKAGE_NAME}/logs/
|
|
|
|
# Create archive
|
|
cd dist/
|
|
echo "🗜️ Creating ZIP archive..."
|
|
zip -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ -x "*.DS_Store" "*.git*" "vendor/*" "node_modules/*"
|
|
|
|
# Create tar.gz archive
|
|
echo "🗜️ Creating TAR.GZ archive..."
|
|
tar -czf ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}/
|
|
|
|
# Calculate checksums
|
|
echo "🔐 Calculating checksums..."
|
|
sha256sum ${PACKAGE_NAME}.zip > ${PACKAGE_NAME}.zip.sha256
|
|
sha256sum ${PACKAGE_NAME}.tar.gz > ${PACKAGE_NAME}.tar.gz.sha256
|
|
|
|
cd ..
|
|
|
|
# Display results
|
|
echo ""
|
|
echo "✅ Package creation completed!"
|
|
echo ""
|
|
echo "📁 Generated files:"
|
|
ls -la dist/
|
|
echo ""
|
|
echo "📊 Package statistics:"
|
|
echo "Files: $(find dist/${PACKAGE_NAME}/ -type f | wc -l)"
|
|
echo "Directories: $(find dist/${PACKAGE_NAME}/ -type d | wc -l)"
|
|
echo "ZIP size: $(du -h dist/${PACKAGE_NAME}.zip | cut -f1)"
|
|
echo "TAR.GZ size: $(du -h dist/${PACKAGE_NAME}.tar.gz | cut -f1)"
|
|
echo ""
|
|
echo "🚀 Ready for distribution!"
|
|
echo "Share the files in dist/ directory"
|
|
echo ""
|
|
echo "📋 Installation instructions for end users:"
|
|
echo "1. Extract the archive"
|
|
echo "2. cd ${PACKAGE_NAME}/"
|
|
echo "3. chmod +x install.sh && ./install.sh"
|
|
echo "4. composer start"
|
|
echo "5. Visit: http://localhost:8080"
|