source it
This commit is contained in:
parent
3cf3770bea
commit
811c6d45b4
39
helper
39
helper
@ -1,17 +1,36 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [[ "$1" == "composer" ]]; then
|
# Function to handle PHP Artisan commands
|
||||||
docker compose run --rm composer composer "${@:2}"
|
php() {
|
||||||
elif [[ "$1" == "fix_storage" ]]; then
|
if [[ "$1" == "artisan" ]]; then
|
||||||
|
docker compose exec fpm php artisan "${@:2}"
|
||||||
|
else
|
||||||
|
echo "Unknown php command"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle Composer commands
|
||||||
|
composer() {
|
||||||
|
docker compose run --rm composer composer "${@}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to handle MySQL commands
|
||||||
|
mysql() {
|
||||||
|
docker compose exec database "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to fix storage permissions
|
||||||
|
fix_storage() {
|
||||||
docker compose exec fpm chown -R www-data:www-data storage/
|
docker compose exec fpm chown -R www-data:www-data storage/
|
||||||
docker compose exec fpm chmod -R ug+rw storage
|
docker compose exec fpm chmod -R ug+rw storage
|
||||||
docker compose exec fpm chmod -R ug+x storage/framework storage/logs
|
docker compose exec fpm chmod -R ug+x storage/framework storage/logs
|
||||||
docker compose exec fpm chmod -R ug+rw bootstrap/cache
|
docker compose exec fpm chmod -R ug+rw bootstrap/cache
|
||||||
docker compose exec fpm chmod -R ug+x bootstrap/cache
|
docker compose exec fpm chmod -R ug+x bootstrap/cache
|
||||||
elif [[ "$1" == "mysql" ]]; then
|
}
|
||||||
docker compose exec database "$@"
|
|
||||||
elif [[ "$1" == "init" ]]; then
|
# Function to initialize the composer.yml file
|
||||||
cat <<EOL > compose.yml
|
init() {
|
||||||
|
cat <<EOL > composer.yml
|
||||||
services:
|
services:
|
||||||
fpm:
|
fpm:
|
||||||
hostname: fpm
|
hostname: fpm
|
||||||
@ -43,7 +62,5 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./.db:/var/lib/mysql
|
- ./.db:/var/lib/mysql
|
||||||
EOL
|
EOL
|
||||||
echo "compose.yml file created successfully!"
|
echo "composer.yml file created successfully!"
|
||||||
else
|
}
|
||||||
docker compose exec fpm "$@"
|
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user