Merge branch '145-build-system-rewrite' of https://dev.azure.com/fraport/Fahrerausbildung/_git/FRADrive into 145-build-system-rewrite
This commit is contained in:
commit
0016905673
25
Makefile
25
Makefile
@ -27,6 +27,8 @@ export SERVICE_PARALLEL ?= false
|
||||
export JOB
|
||||
export JOB_ID
|
||||
export CONTAINER_CMD
|
||||
export ENTRYPOINT
|
||||
export EXEC_OPTS
|
||||
|
||||
export BASE_PORTS
|
||||
export UNIWORXDB_OPTS ?= -cf
|
||||
@ -267,17 +269,26 @@ status:
|
||||
log-%:
|
||||
$(CONTAINER_COMMAND) logs --follow `cat $(DEVELOP)/$* | grep CONTAINER_ID= | sed 's/^CONTAINER_ID=//'`
|
||||
|
||||
# TODO: rework shells
|
||||
.PHONY: %-shell
|
||||
# HELP: launch shell (bash) inside a currently running container
|
||||
%-shell: --%_shell;
|
||||
--shell:
|
||||
$(CONTAINER_COMMAND) exec -it $(EXEC_OPTS) fradrive.$(CURR_DEV).$* $(if $(ENTRYPOINT),$(ENTRYPOINT),/bin/bash)
|
||||
.PHONY: enter
|
||||
# HELP: launch (bash) shell inside a currently running container. Use ./enter shell wrapper for more convenient usage, possibly with tab-completion in the future
|
||||
enter: --ensure-develop
|
||||
$(MAKE) -- --shell
|
||||
|
||||
.PHONY: psql
|
||||
# HELP: enter psql (postgresql) cli inside a currently running database container
|
||||
psql: ENTRYPOINT=/usr/bin/psql -d uniworx
|
||||
psql: EXEC_OPTS=--user postgres
|
||||
psql: --database-shell;
|
||||
psql: --ensure-develop
|
||||
$(MAKE) -- --shell CONTAINER_FILE=develop/`cat develop/.current`/start-postgres
|
||||
|
||||
.PHONY: ghci
|
||||
# HELP: launch new backend instance and enter interactive ghci shell (WIP)
|
||||
ghci: ENTRYPOINT=stack ghci
|
||||
ghci: --shell;
|
||||
|
||||
--shell:
|
||||
CONTAINER_ID=`cat $(CONTAINER_FILE) | grep 'CONTAINER_ID=' | sed 's/CONTAINER_ID=//'` ; \
|
||||
$(CONTAINER_COMMAND) exec -it $(EXEC_OPTS) $${CONTAINER_ID} $(if $(ENTRYPOINT),$(ENTRYPOINT),/bin/bash)
|
||||
|
||||
# TODO: rework stops
|
||||
.PHONY: stop
|
||||
|
||||
Loading…
Reference in New Issue
Block a user