mirror of https://github.com/samply/bridgehead.git
Support docker compose as well as docker-compose
This commit is contained in:
parent
c7f727afff
commit
5755baaf00
|
@ -63,10 +63,10 @@ case "$ACTION" in
|
||||||
hc_send log "Bridgehead $PROJECT startup: Checking requirements ..."
|
hc_send log "Bridgehead $PROJECT startup: Checking requirements ..."
|
||||||
checkRequirements
|
checkRequirements
|
||||||
hc_send log "Bridgehead $PROJECT startup: Requirements checked out. Now starting bridgehead ..."
|
hc_send log "Bridgehead $PROJECT startup: Requirements checked out. Now starting bridgehead ..."
|
||||||
exec docker-compose -f ./$PROJECT/docker-compose.yml $OVERRIDE up --abort-on-container-exit
|
exec $COMPOSE -f ./$PROJECT/docker-compose.yml $OVERRIDE up --abort-on-container-exit
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
exec docker-compose -f ./$PROJECT/docker-compose.yml $OVERRIDE down
|
exec $COMPOSE -f ./$PROJECT/docker-compose.yml $OVERRIDE down
|
||||||
;;
|
;;
|
||||||
update)
|
update)
|
||||||
exec ./lib/update-bridgehead.sh $PROJECT
|
exec ./lib/update-bridgehead.sh $PROJECT
|
||||||
|
|
|
@ -10,9 +10,15 @@ fi
|
||||||
checkOwner . bridgehead || exit 1
|
checkOwner . bridgehead || exit 1
|
||||||
checkOwner /etc/bridgehead bridgehead || exit 1
|
checkOwner /etc/bridgehead bridgehead || exit 1
|
||||||
|
|
||||||
|
if [[ "$(docker compose version 2>/dev/null)" == *"Docker Compose version"* ]]; then
|
||||||
|
COMPOSE="docker compose"
|
||||||
|
else
|
||||||
|
COMPOSE="docker-compose"
|
||||||
|
fi
|
||||||
|
|
||||||
## Check if user is a su
|
## Check if user is a su
|
||||||
log INFO "Checking if all prerequisites are met ..."
|
log INFO "Checking if all prerequisites are met ..."
|
||||||
prerequisites="git docker docker-compose"
|
prerequisites="git docker $COMPOSE"
|
||||||
for prerequisite in $prerequisites; do
|
for prerequisite in $prerequisites; do
|
||||||
$prerequisite --version 2>&1
|
$prerequisite --version 2>&1
|
||||||
is_available=$?
|
is_available=$?
|
||||||
|
|
Loading…
Reference in New Issue