Skip to content

Commit

Permalink
fix(setup_admin_user): Script should be flexible on docker-compose
Browse files Browse the repository at this point in the history
Newer version of docker-compose is called as "docker compose", so try
automatically to use it, if docker-compose is missing.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Dec 12, 2024
1 parent 19066a0 commit e0db4df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/setup_admin_user
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/bin/bash

# is docker-compose exists? if not use docker compose
if [ -z "$(which docker-compose)" ]; then
echo "docker-compose is not installed, using docker compose"
DOCKER_COMPOSE="docker compose"
else
DOCKER_COMPOSE="docker-compose"
fi

set -e

docker-compose run api python3 -m api.admin $*
${DOCKER_COMPOSE} run api python3 -m api.admin $*

exit 0

0 comments on commit e0db4df

Please sign in to comment.