-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from YuriiDorosh/features/scripts
Features/scripts
- Loading branch information
Showing
7 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```bash | ||
chmod +x *.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Check for Docker | ||
if ! command -v docker &> /dev/null; then | ||
echo "Docker could not be found. Please install Docker." | ||
exit 1 | ||
fi | ||
|
||
# Check for Docker Compose | ||
if ! command -v docker-compose &> /dev/null; then | ||
echo "Docker Compose could not be found. Please install Docker Compose." | ||
exit 1 | ||
fi | ||
|
||
echo "Docker and Docker Compose are installed." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
read -p "Are you sure you want to clear the Redis cache? [y/N] " -n 1 -r | ||
echo | ||
if [[ $REPLY =~ ^[Yy]$ ]]; then | ||
docker-compose exec redis redis-cli FLUSHALL | ||
echo "Redis cache cleared." | ||
else | ||
echo "Operation cancelled." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "Running migrations..." | ||
docker-compose exec app php spark migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
SEEDER=${1:-} # Optional seeder name as first argument | ||
|
||
if [ -z "$SEEDER" ]; then | ||
echo "Running all seeders..." | ||
docker-compose exec app php spark db:seed | ||
else | ||
echo "Running seeder: $SEEDER" | ||
docker-compose exec app php spark db:seed $SEEDER | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Load Environment or use default | ||
ENVIRONMENT=${1:-development} | ||
|
||
# Check Docker and Docker Compose availability | ||
./scripts/check_docker.sh || exit 1 | ||
|
||
echo "Starting project in $ENVIRONMENT mode..." | ||
docker-compose -f docker-compose.yml -f docker-compose.$ENVIRONMENT.yml up -d |