-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
38 lines (30 loc) · 1.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
all: openslides
build-dev:
docker build . --target development --tag openslides-manage-dev
run-tests:
docker build . --target testing --tag openslides-manage-test
docker run openslides-manage-test
test:
# Attention: This steps should be the same as in .github/workflows/test.yml.
test -z "$(shell gofmt -l .)"
go vet ./...
go install golang.org/x/lint/golint@latest
golint -set_exit_status ./...
go test -timeout 10s -race ./...
go-build:
go build ./cmd/openslides
protoc:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=require_unimplemented_servers=false:. --go-grpc_opt=paths=source_relative \
proto/manage.proto
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
openslides:
docker build . --target builder --tag openslides-manage-builder
docker run --interactive --tty --volume $(dir $(mkfile_path)):/build/ --rm openslides-manage-builder sh -c " \
if [ $(shell whoami) != root ]; then \
addgroup -g $(shell id -g) build ; \
adduser -u $(shell id -u) -G build -D build ; \
chown build: /root/openslides ; \
fi; \
cp -p /root/openslides /build/"
.PHONY: openslides