Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

move run script to /scripts

Andras Bacsaidea1164b1dbf
diff --git a/run b/run
deleted file mode 100755
index 81b90a6086..0000000000
--- a/run
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-
-# Inspired on https://github.com/adriancooney/Taskfile
-#
-# Install an alias, to be able to simply execute `run`
-# echo 'alias run=./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
-
-SAIL=./vendor/bin/sail
-export WWWUSER=${WWWUSER:-$UID}
-export WWWGROUP=${WWWGROUP:-$(id -g)}
-
-function help {
- echo "$0 <task> <args>"
- echo "Tasks:"
- compgen -A function | cat -n
-}
-
-function default {
- help
-}
-
-function wait_db {
- TRIES=0
- MAX_TRIES=15
- WAIT=4
-
- until $DOCKER_COMPOSE exec postgres bash -c "psql -U coolify -d coolify -t -q -c \"SELECT datname FROM pg_database;\" " | grep coolify
- do
- ((TRIES++))
- if [ $TRIES -gt $MAX_TRIES ]; then
- echo "Database is not ready after $MAX_TRIES tries. Exiting."
- exit 1
- fi
- echo "Database is not ready yet. Attempt $TRIES/$MAX_TRIES. Waiting $WAIT seconds before next try..."
- sleep $WAIT
- done
-}
-
-TIMEFORMAT="Task completed in %3lR"
-time "${@:-default}"
diff --git a/scripts/run b/scripts/run
index 0888bd9d22..81b90a6086 100755
--- a/scripts/run
+++ b/scripts/run
@@ -1,11 +1,25 @@
#!/usr/bin/env bash
# Inspired on https://github.com/adriancooney/Taskfile
-# Install an alias, to be able to simply execute `run` => echo 'alias run=./run' >> ~/.aliases
+#
+# Install an alias, to be able to simply execute `run`
+# echo 'alias run=./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
+
+SAIL=./vendor/bin/sail
+export WWWUSER=${WWWUSER:-$UID}
+export WWWGROUP=${WWWGROUP:-$(id -g)}
+
function help {
echo "$0 <task> <args>"
echo "Tasks:"
@@ -16,23 +30,21 @@ function default {
help
}
-function bash {
- docker-compose exec -u $(id -u) php bash
-}
-
-# The user with native SSH capability
-function coolify-bash {
- docker-compose exec -u coolify php bash
-}
-
-function root-bash {
- docker-compose exec php bash
-}
-
-# Usage: ./Taskfile envFile:set FOOBAR abc
-# This will set the FOOBAR variable to "abc" in the .env file
-function envFile:set {
- sed -i "s#^$1=.*#$1=$2#g" .env
+function wait_db {
+ TRIES=0
+ MAX_TRIES=15
+ WAIT=4
+
+ until $DOCKER_COMPOSE exec postgres bash -c "psql -U coolify -d coolify -t -q -c \"SELECT datname FROM pg_database;\" " | grep coolify
+ do
+ ((TRIES++))
+ if [ $TRIES -gt $MAX_TRIES ]; then
+ echo "Database is not ready after $MAX_TRIES tries. Exiting."
+ exit 1
+ fi
+ echo "Database is not ready yet. Attempt $TRIES/$MAX_TRIES. Waiting $WAIT seconds before next try..."
+ sleep $WAIT
+ done
}
TIMEFORMAT="Task completed in %3lR"