forked from getsentry/self-hosted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (30 loc) · 1.31 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
REPOSITORY?=sentry-onpremise
TAG?=latest
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m
build:
@echo "$(OK_COLOR)==>$(NO_COLOR) Building $(REPOSITORY):$(TAG)"
@docker build --rm -t $(REPOSITORY):$(TAG) .
$(REPOSITORY)_$(TAG).tar: build
@echo "$(OK_COLOR)==>$(NO_COLOR) Saving $(REPOSITORY):$(TAG) > $@"
@docker save $(REPOSITORY):$(TAG) > $@
push: build
@echo "$(OK_COLOR)==>$(NO_COLOR) Pushing $(REPOSITORY):$(TAG)"
@docker push $(REPOSITORY):$(TAG)
start: build
@echo "$(OK_COLOR)==>$(NO_COLOR) Removing existing containers of $(REPOSITORY):$(TAG)"
@docker rm sentry-web || true
@docker rm sentry-worker || true
@docker rm sentry-cron || true
@echo "$(OK_COLOR)==>$(NO_COLOR) Staring Web $(REPOSITORY):$(TAG)"
@docker run --detach --env-file .env --name sentry-web --publish 9000:9000 $(REPOSITORY) run web
@echo "$(OK_COLOR)==>$(NO_COLOR) Staring Worker $(REPOSITORY):$(TAG)"
@docker run --detach --env-file .env --name sentry-worker $(REPOSITORY) run worker
@echo "$(OK_COLOR)==>$(NO_COLOR) Staring Cron $(REPOSITORY):$(TAG)"
@docker run --detach --env-file .env --name sentry-cron $(REPOSITORY) run cron
stop:
@echo "$(OK_COLOR)==>$(NO_COLOR) Stop running containers of $(REPOSITORY):$(TAG)"
@docker stop sentry-web || true
@docker stop sentry-worker || true
@docker stop sentry-cron || true
.PHONY: start stop build push