Skip to content

Commit 6664cee

Browse files
committed
add support for docker-compose.yml renaming
1 parent e894116 commit 6664cee

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

apps/drone/dcape-app/Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ DCAPE_NET ?= $(DCAPE_TAG)
2323
PG_CONTAINER ?= $(DCAPE_TAG)_db_1
2424
DCAPE_COMPOSE ?= $(DCAPE_TAG)-compose
2525
DCAPE_DC_YML ?= /opt/dcape-app/docker-compose.yml
26+
DCAPE_APP_DC_YML?= docker-compose.yml
2627
DCAPE_DC_USED ?= true
2728
PERSIST_FILES ?=
2829
# Empty or 'keep'
@@ -96,16 +97,16 @@ down: dc
9697
# $$PWD usage allows host directory mounts in child containers
9798
# Thish works if path is the same for host, docker, docker-compose and child container
9899
## run $(CMD) via docker-compose
99-
dc: docker-compose.yml
100+
dc: $(DCAPE_APP_DC_YML)
100101
@echo $(APP_TAG)
101-
@[ "$(DCAPE_DC_USED)" != true ] || args="-f $(DCAPE_DC_YML) -f docker-compose.yml" ; \
102+
@[ "$(DCAPE_DC_USED)" != true ] || args="-f $(DCAPE_DC_YML)" ; \
102103
docker run --rm -i \
103104
-v /var/run/docker.sock:/var/run/docker.sock \
104105
-v $$PWD:$$PWD -w $$PWD \
105106
-e DCAPE_TAG -e DCAPE_NET -e APP_ROOT -e APP_TAG \
106107
$(DCAPE_COMPOSE) \
107108
-p $$APP_TAG --env-file $(CFG) \
108-
$$args $(CMD)
109+
$$args -f $(DCAPE_APP_DC_YML) $(CMD)
109110

110111
# ------------------------------------------------------------------------------
111112
## DB operations
@@ -218,18 +219,18 @@ init:
218219
config: $(CFGSAMPLE)
219220

220221
$(CFGSAMPLE):
221-
@echo "$$CONFIG_DEF$$CONFIG_DB$$CONFIG_USER$$CONFIG_CUSTOM" > $@
222+
@echo "$$CONFIG_DEF$$CONFIG_DB$$CONFIG_USER\n$$CONFIG_CUSTOM" > $@
222223

223224
# -----------------------------------------------------------------------------
224225

225226
## run app by drone,
226227
## use inside .drone.yml only
227228
.drone-default:
228229
@echo "*** $@ ***" ; \
229-
[ $$USE_DB != yes ] || $(MAKE) -s db-create ; \
230+
[ "$$USE_DB" != "yes" ] || $(MAKE) -s db-create ; \
230231
[ -z "$$PERSIST_FILES" ] || . setup root $(SETUP_ROOT_OPTS); cp -r $$PERSIST_FILES $$APP_ROOT ; \
231-
[ "$(DCAPE_DC_USED)" != true ] || args="-f $(DCAPE_DC_YML) -f docker-compose.yml" ; \
232-
docker-compose -p $(APP_TAG) --env-file $(CFG) $$args up -d --force-recreate
232+
[ "$(DCAPE_DC_USED)" != true ] || args="-f $(DCAPE_DC_YML)" ; \
233+
docker-compose -p $(APP_TAG) --env-file $(CFG) $$args -f $(DCAPE_APP_DC_YML) up -d --force-recreate
233234

234235
# ------------------------------------------------------------------------------
235236
## Other

0 commit comments

Comments
 (0)