Skip to content

Commit 7bc1f9d

Browse files
committed
feat: docker-composer command as variable
allows to switch to 'docker compose'
1 parent 1ca4021 commit 7bc1f9d

File tree

23 files changed

+25
-342
lines changed

23 files changed

+25
-342
lines changed

Makefile

Lines changed: 0 additions & 320 deletions
This file was deleted.

commands/_internals/addSshKey.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ function _addSshKey() {
1010

1111
local oldPwd=$(pwd)
1212
cd ${ROOT_DIR}
13-
docker-compose exec ssh-agent sh -c /import-keys.sh
13+
${DOCKER_COMPOSE} exec ssh-agent sh -c /import-keys.sh
1414
cd ${oldPwd}
1515
}

commands/_internals/serviceExists.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ _serviceExists() {
1111
}
1212

1313
_existingServices() {
14-
docker-compose ps --services
14+
${DOCKER_COMPOSE} ps --services
1515
}

commands/local.sh.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# custom Browser for the open command
22
#DDE_BROWSER=/usr/bin/firefox
33

4+
#DOCKER_COMPOSE='docker compose'
5+
46
function _local_someGlobalHelperFunction() {
57
echo "a global helper function"
68
}

commands/project/destroy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function project:destroy() {
88
_checkProject
99

1010
_logYellow "Removing containers"
11-
docker-compose down --remove-orphans
11+
${DOCKER_COMPOSE} down --remove-orphans
1212

1313
_logYellow "Deleting SSL certs"
1414

commands/project/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function project:env() {
2020

2121
echo ""
2222
_logYellow "Project services"
23-
docker-compose ps --services
23+
${DOCKER_COMPOSE} ps --services
2424

2525
}
2626

commands/project/exec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function project:exec() {
2121
fi
2222
fi
2323

24-
docker-compose exec ${service} /bin/sh -c "if [ -f /usr/bin/doas ]; then doas -u dde sh; else gosu dde sh; fi"
24+
${DOCKER_COMPOSE} exec ${service} /bin/sh -c "if [ -f /usr/bin/doas ]; then doas -u dde sh; else gosu dde sh; fi"
2525
}
2626

2727
function p:e() {

commands/project/exec/root.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
function project:exec:root() {
99
_checkProject
10-
docker-compose exec $(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//') sh
10+
${DOCKER_COMPOSE} exec $(docker run --rm -v $(pwd):/workdir mikefarah/yq:3 yq r --printMode p docker-compose.yml 'services.*' | head -n1 | sed 's/.*\.//') sh
1111
}
1212

1313
function p:e:r() {

commands/project/log.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function project:log() {
2020
fi
2121
fi
2222

23-
docker-compose logs -f --tail=100 ${service}
23+
${DOCKER_COMPOSE} logs -f --tail=100 ${service}
2424
}
2525

2626
function p:l() {

commands/project/open.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function project:open() {
1313

1414
_serviceExists web
1515

16-
for openUrl in $(docker-compose config | _yq_stdin e '.services.*.environment.OPEN_URL'); do
16+
for openUrl in $(${DOCKER_COMPOSE} config | _yq_stdin e '.services.*.environment.OPEN_URL'); do
1717
if [[ "${openUrl}" != "null" ]]; then
1818
_logGreen "open ${openUrl}"
1919

0 commit comments

Comments
 (0)