- Multi-language source code (Python, JavaScript, Java, C++, Go) - Configuration files (JSON, YAML, INI) - Sample data files (CSV, JSON, logs) - Binary and media assets (PNG, SVG, PDF) - Test files and deployment scripts - Nested directory structure for testing Git features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
71 lines
1.5 KiB
Bash
Executable File
71 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Deployment script for sandbox project
|
|
|
|
set -e # Exit on any error
|
|
|
|
echo "Starting deployment process..."
|
|
|
|
# Configuration
|
|
ENVIRONMENT=${1:-development}
|
|
BUILD_DIR="./build"
|
|
BACKUP_DIR="./backups"
|
|
|
|
echo "Environment: $ENVIRONMENT"
|
|
|
|
# Create necessary directories
|
|
mkdir -p $BUILD_DIR
|
|
mkdir -p $BACKUP_DIR
|
|
|
|
# Backup current deployment
|
|
if [ -d "$BUILD_DIR/current" ]; then
|
|
echo "Creating backup of current deployment..."
|
|
timestamp=$(date +%Y%m%d_%H%M%S)
|
|
cp -r $BUILD_DIR/current $BACKUP_DIR/backup_$timestamp
|
|
fi
|
|
|
|
# Build the project
|
|
echo "Building project..."
|
|
if [ -f "package.json" ]; then
|
|
npm install
|
|
npm run build
|
|
fi
|
|
|
|
# Run tests
|
|
echo "Running tests..."
|
|
if [ -f "package.json" ]; then
|
|
npm test
|
|
fi
|
|
|
|
if [ -f "requirements.txt" ]; then
|
|
pip install -r requirements.txt
|
|
pytest tests/ || echo "Python tests not found, skipping..."
|
|
fi
|
|
|
|
# Deploy
|
|
echo "Deploying to $ENVIRONMENT..."
|
|
case $ENVIRONMENT in
|
|
"production")
|
|
echo "Production deployment - implementing safety checks..."
|
|
# Add production-specific deployment steps
|
|
;;
|
|
"staging")
|
|
echo "Staging deployment..."
|
|
# Add staging-specific deployment steps
|
|
;;
|
|
"development")
|
|
echo "Development deployment..."
|
|
# Add development-specific deployment steps
|
|
;;
|
|
*)
|
|
echo "Unknown environment: $ENVIRONMENT"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Health check
|
|
echo "Performing health check..."
|
|
# Add health check logic here
|
|
|
|
echo "Deployment completed successfully!"
|
|
echo "Deployed at: $(date)" |