martin/demo/justfile
Just van den Broecke a864b9981c
Adapt justfiles for Docker Compose command (#1153)
This should solve #1149. See also [my comment there for the
approach](https://github.com/maplibre/martin/issues/11). In short
through a variable that is substituted. Note that this may not work if
an older Docker version is installed without the Python `docker-compose`
script...As both variants will not be present. Maybe add an extra
test+warning msg for that case.

```
dockercompose := `if docker-compose --version &> /dev/null; then echo "docker-compose"; else echo "docker compose"; fi`
.
.
up:
   {{ dockercompose }} up

up-build:
    {{ dockercompose }} up --build
.
.
```

---------

Co-authored-by: Lucas <zhangyijunmetro@hotmail.com>
2024-01-29 13:15:10 -05:00

31 lines
598 B
Makefile

#!/usr/bin/env just --justfile
set shell := ["bash", "-c"]
dockercompose := `if docker-compose --version &> /dev/null; then echo "docker-compose"; else echo "docker compose"; fi`
@_default:
just --list --unsorted
clean:
rm -rf frontend/node_modules
up:
{{ dockercompose }} up
up-build:
{{ dockercompose }} up --build
build:
{{ dockercompose }} build
up-backend:
{{ dockercompose }} up db tiles --detach
frontend *ARGS:
{{ dockercompose }} up frontend {{ ARGS }}
[no-exit-message]
frontend-sh:
{{ dockercompose }} run --interactive --entrypoint sh frontend