mobilizon.chapril.org-mobil.../Makefile

39 lines
1.3 KiB
Makefile
Raw Normal View History

2018-12-17 11:24:26 +01:00
init:
@bash docker/message.sh "Start"
2018-12-17 11:24:26 +01:00
make start
setup: stop
@bash docker/message.sh "Compiling everything"
docker-compose run --rm api bash -c 'mix deps.get; yarn --cwd "js"; yarn --cwd "js" build:pictures; mix ecto.create; mix ecto.migrate'
migrate:
docker-compose run --rm api mix ecto.migrate
logs:
docker-compose logs -f
2018-12-17 11:24:26 +01:00
start: stop
@bash docker/message.sh "Starting Mobilizon with Docker"
docker-compose up -d api
@bash docker/message.sh "Docker server started"
2018-12-17 11:24:26 +01:00
stop:
@bash docker/message.sh "Stopping Mobilizon"
2018-12-17 11:24:26 +01:00
docker-compose down
@bash docker/message.sh "Mobilizon is stopped"
2019-04-17 17:17:27 +02:00
test: stop
@bash docker/message.sh "Running tests"
docker-compose -f docker-compose.yml -f docker-compose.test.yml run api mix test $(only)
@bash docker/message.sh "Done running tests"
2021-10-19 09:50:24 +02:00
format:
docker-compose run --rm api bash -c "mix format && mix credo --strict"
@bash docker/message.sh "Code is now ready to commit :)"
2018-12-17 11:24:26 +01:00
target: init
RELEASE_TAG=$(shell git tag --list '[0-9]*.[0-9]*.[0-9]*' | tail -n1)
release:
mix local.hex --force
mix local.rebar --force
mix deps.get --only-prod
mix compile
mix phx.digest.clean --all && mix phx.digest
mix release --path release/mobilizon
cd release/mobilizon && ln -s lib/mobilizon-*/priv priv
tar czf mobilizon-$(RELEASE_TAG).tar.gz -C release mobilizon