-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
47 lines (40 loc) · 941 Bytes
/
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
39
40
41
42
43
44
45
46
47
PROJECT ?= rouge-dingus
# Use git tags to set the version string
VERSION ?= $(shell git describe --tags --always)
TAG := $(VERSION)
DEV_TAG ?= dev
IMAGE := $(PROJECT):$(TAG)
PLATFORM := linux/amd64
HOST_PORT ?= 9292
.PHONY: build-dev
build-dev: Dockerfile
@docker buildx build --rm --platform=$(PLATFORM) \
-t "$(PROJECT):$(DEV_TAG)" \
-f Dockerfile.dev .
.PHONY: build
build: Dockerfile
@docker buildx build --rm --platform=$(PLATFORM) \
-t "$(IMAGE)" .
.PHONY: run
run:
@docker run --rm \
--platform=$(PLATFORM) \
--name $(PROJECT) \
--publish $(HOST_PORT):9292 \
"$(IMAGE)"
.PHONY: test
test:
@docker run --rm -it \
--platform=$(PLATFORM) \
--name $(PROJECT) \
--volume $(PWD):/app \
"$(PROJECT):$(DEV_TAG)" \
bundle exec rake test
.PHONY: shell
shell:
@docker run --rm -it \
--platform=$(PLATFORM) \
--name $(PROJECT) \
--volume $(PWD):/app \
"$(PROJECT):$(DEV_TAG)" \
bash