97 lines
2.0 KiB
Bash
Executable File
97 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Inspired on https://github.com/adriancooney/Taskfile
|
|
#
|
|
# Install an alias, to be able to simply execute `run`
|
|
# echo 'alias run=./scripts/run' >> ~/.aliases
|
|
#
|
|
# Define Docker Compose command prefix...
|
|
set -e
|
|
|
|
if [ $? == 0 ]; then
|
|
DOCKER_COMPOSE="docker compose"
|
|
else
|
|
DOCKER_COMPOSE="docker-compose"
|
|
fi
|
|
|
|
function help {
|
|
echo "$0 <task> <args>"
|
|
echo "Tasks:"
|
|
compgen -A function | cat -n
|
|
}
|
|
|
|
function sync:bunny {
|
|
php artisan sync:bunny --env=secrets
|
|
}
|
|
|
|
function queue {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan queue:listen
|
|
}
|
|
|
|
function horizon {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan horizon -vvv
|
|
}
|
|
|
|
function schedule {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan schedule:work
|
|
}
|
|
|
|
function schedule:run {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan schedule:run
|
|
}
|
|
|
|
function db:reset {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --seed
|
|
}
|
|
|
|
function db {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan db
|
|
}
|
|
|
|
function db:migrate {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan migrate
|
|
}
|
|
|
|
function db:reset-prod {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||
|
|
php artisan migrate:fresh --force --seed --seeder=ProductionSeeder
|
|
}
|
|
|
|
function mfs {
|
|
db:reset
|
|
}
|
|
|
|
function coolify {
|
|
bash vendor/bin/spin exec -u webuser coolify bash
|
|
}
|
|
|
|
function coolify:root {
|
|
bash vendor/bin/spin exec coolify bash
|
|
}
|
|
function coolify:proxy {
|
|
docker exec -ti coolify-proxy sh
|
|
}
|
|
|
|
function redis {
|
|
docker exec -ti coolify-redis redis-cli
|
|
}
|
|
|
|
function vite {
|
|
bash vendor/bin/spin exec vite bash
|
|
}
|
|
|
|
function tinker {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan tinker
|
|
}
|
|
|
|
|
|
function build:builder {
|
|
act -W .github/workflows/coolify-builder.yml --secret-file .env.secrets
|
|
}
|
|
function default {
|
|
help
|
|
}
|
|
|
|
TIMEFORMAT="Task completed in %3lR"
|
|
time "${@:-default}"
|