Added backend Makefile
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Dominic Grimm 2022-02-07 19:25:18 +01:00
parent 3cf2a580c4
commit 420ef6f984
4 changed files with 18 additions and 5 deletions

View file

@ -24,10 +24,10 @@ steps:
commands:
- pgsanity docker/backend/db/**/*.sql
- name: documentation
image: crystal-lang/crystal:latest-alpine
image: crystallang/crystal:latest-alpine
commands:
- cd docker/backend/
- crystal docs
- make docs
- name: build
image: tmaier/docker-compose
volumes:

View file

@ -4,4 +4,4 @@ A fullstack application for assigning mentors to students based on their whishes
# Documentation
To build the documentation, run `crystal docs` in `docker/backend/`.
To build the documentation, run `make docs` in `docker/backend/`.

View file

@ -9,12 +9,13 @@ ARG BUILD_ENV
WORKDIR /app/backend
COPY --from=deps /app/shard.yml /app/shard.lock ./
COPY --from=deps /app/lib ./lib
COPY ./Makefile ./Makefile
COPY ./LICENSE ./LICENSE
COPY ./src ./src
RUN if [ "${BUILD_ENV}" = "development" ]; then \
time shards build -Ddevelopment --static --verbose -s -p -t; \
make dev; \
else \
time shards build --static --release --no-debug --verbose -s -p -t; \
make; \
fi
FROM alpine as runner

12
docker/backend/Makefile Normal file
View file

@ -0,0 +1,12 @@
.PHONY: all dev prod docs
all: prod
dev:
shards build -Ddevelopment --static --verbose -s -p -t
prod:
shards build --static --release --no-debug --verbose -s -p -t
docs:
crystal docs --project-name "Mentorenwahl Backend"