File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,4 +263,31 @@ nginx_docker_restart:
263263
264264# Connect to the Nginx container
265265nginx_shell :
266- docker-compose exec nginx sh
266+ docker-compose exec nginx sh
267+
268+ # Scripts Commands
269+ # -------------------------------------------------
270+
271+ # Start the project with optional environment argument (e.g., make start_project ENV=production)
272+ start_project :
273+ ./scripts/start_project.sh $(ENV )
274+
275+ # Stop the project
276+ stop_project :
277+ ./scripts/stop_project.sh
278+
279+ # Restart the project
280+ restart_project :
281+ ./scripts/restart_project.sh
282+
283+ # Run migrations
284+ migrate :
285+ ./scripts/run_migrations.sh
286+
287+ # Run seeders (use SEEDER=seeder_name to specify a seeder)
288+ seed :
289+ ./scripts/run_seed.sh $(SEEDER )
290+
291+ # Clear Redis cache with confirmation
292+ clear_cache :
293+ ./scripts/clear_cache.sh
Original file line number Diff line number Diff line change 1+ ``` bash
2+ chmod +x * .sh
3+ ```
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Check for Docker
4+ if ! command -v docker & > /dev/null; then
5+ echo " Docker could not be found. Please install Docker."
6+ exit 1
7+ fi
8+
9+ # Check for Docker Compose
10+ if ! command -v docker-compose & > /dev/null; then
11+ echo " Docker Compose could not be found. Please install Docker Compose."
12+ exit 1
13+ fi
14+
15+ echo " Docker and Docker Compose are installed."
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ read -p " Are you sure you want to clear the Redis cache? [y/N] " -n 1 -r
4+ echo
5+ if [[ $REPLY =~ ^[Yy]$ ]]; then
6+ docker-compose exec redis redis-cli FLUSHALL
7+ echo " Redis cache cleared."
8+ else
9+ echo " Operation cancelled."
10+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Running migrations..."
4+ docker-compose exec app php spark migrate
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ SEEDER=${1:- } # Optional seeder name as first argument
4+
5+ if [ -z " $SEEDER " ]; then
6+ echo " Running all seeders..."
7+ docker-compose exec app php spark db:seed
8+ else
9+ echo " Running seeder: $SEEDER "
10+ docker-compose exec app php spark db:seed $SEEDER
11+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Load Environment or use default
4+ ENVIRONMENT=${1:- development}
5+
6+ # Check Docker and Docker Compose availability
7+ ./scripts/check_docker.sh || exit 1
8+
9+ echo " Starting project in $ENVIRONMENT mode..."
10+ docker-compose -f docker-compose.yml -f docker-compose.$ENVIRONMENT .yml up -d
You can’t perform that action at this time.
0 commit comments