61 lines
1.4 KiB
Bash
Executable File
61 lines
1.4 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
|
|
|
|
docker compose &>/dev/null
|
|
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 queue {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan queue:listen
|
|
}
|
|
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 reset-db {
|
|
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --seed
|
|
}
|
|
function coolify {
|
|
bash vendor/bin/spin exec -u webuser coolify bash
|
|
}
|
|
function coolify-root {
|
|
bash vendor/bin/spin exec coolify bash
|
|
}
|
|
function vite {
|
|
bash vendor/bin/spin exec vite bash
|
|
}
|
|
|
|
function build-prod {
|
|
if [ "$1" ]; then
|
|
echo "Building version $1"
|
|
docker build -t ghcr.io/coollabsio/coolify:$1 -f docker/prod-ssu/Dockerfile .
|
|
else
|
|
echo "Building version 4.0.0-nightly.1"
|
|
docker build -t ghcr.io/coollabsio/coolify:4.0.0-nightly.1 -f docker/prod-ssu/Dockerfile .
|
|
fi
|
|
}
|
|
|
|
function default {
|
|
help
|
|
}
|
|
|
|
TIMEFORMAT="Task completed in %3lR"
|
|
time "${@:-default}"
|