coolify/scripts/run

92 lines
1.9 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# Inspired on https://github.com/adriancooney/Taskfile
2023-04-04 15:30:45 +02:00
#
# Install an alias, to be able to simply execute `run`
2023-04-24 13:25:02 +02:00
# echo 'alias run=./scripts/run' >> ~/.aliases
#
2023-04-04 15:30:45 +02:00
# Define Docker Compose command prefix...
set -e
2023-04-04 15:30:45 +02:00
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
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function sync:bunny {
2023-05-03 09:57:06 +02:00
php artisan sync:bunny --env=secrets
2023-04-28 15:22:36 +02:00
}
2023-05-24 14:27:59 +02:00
2023-04-24 13:25:02 +02:00
function queue {
2023-05-16 15:10:29 +02:00
bash vendor/bin/spin exec -u webuser coolify php artisan queue:listen
2023-04-24 13:25:02 +02:00
}
2023-05-24 14:27:59 +02:00
2023-05-23 15:48:05 +02:00
function horizon {
bash vendor/bin/spin exec -u webuser coolify php artisan horizon -vvv
}
2023-05-24 14:27:59 +02:00
2023-04-28 09:00:47 +02:00
function schedule {
bash vendor/bin/spin exec -u webuser coolify php artisan schedule:work
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function schedule:run {
2023-04-28 09:00:47 +02:00
bash vendor/bin/spin exec -u webuser coolify php artisan schedule:run
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function db:reset {
2023-04-24 13:25:02 +02:00
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --seed
}
2023-05-24 14:27:59 +02:00
2023-05-12 20:15:36 +02:00
function mfs {
2023-05-24 14:56:41 +02:00
db:reset
2023-05-12 20:15:36 +02:00
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function db:reset-prod {
2023-05-09 15:10:32 +02:00
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||
2023-05-16 15:10:29 +02:00
php artisan migrate:fresh --force --seed --seeder=ProductionSeeder
2023-05-09 14:45:47 +02:00
}
2023-05-24 14:27:59 +02:00
2023-04-24 13:49:29 +02:00
function coolify {
2023-04-24 13:25:02 +02:00
bash vendor/bin/spin exec -u webuser coolify bash
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function coolify:root {
2023-04-24 13:25:02 +02:00
bash vendor/bin/spin exec coolify bash
}
2023-05-25 12:00:09 +02:00
function coolify:proxy {
docker exec -ti coolify-proxy sh
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:26:50 +02:00
function redis {
docker exec -ti coolify-redis redis-cli
}
2023-05-24 14:27:59 +02:00
2023-04-24 13:25:02 +02:00
function vite {
bash vendor/bin/spin exec vite bash
}
2023-05-24 14:27:59 +02:00
2023-05-03 08:51:11 +02:00
function tinker {
bash vendor/bin/spin exec -u webuser coolify php artisan tinker
}
2023-05-24 14:27:59 +02:00
2023-05-03 08:51:11 +02:00
function db {
bash vendor/bin/spin exec -u webuser coolify php artisan db
}
2023-05-24 14:27:59 +02:00
2023-05-24 14:56:41 +02:00
function build:builder {
2023-05-24 14:27:59 +02:00
act -W .github/workflows/coolify-builder.yml --secret-file .env.secrets
}
function default {
help
}
TIMEFORMAT="Task completed in %3lR"
time "${@:-default}"