-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
61 lines (43 loc) · 1.41 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-include env_make
# Allow using a different docker binary
DOCKER ?= docker
# Force BuildKit mode for builds
# See https://docs.docker.com/buildx/working-with-buildx/
DOCKER_BUILDKIT=1
VERSION ?= 9.4.1
FROM ?= solr:9.4.1-slim
TAG ?= $(VERSION)
IMAGE ?= docksal/solr
BUILD_IMAGE_TAG ?= $(IMAGE):$(VERSION)-build
NAME = docksal-solr-$(VERSION)
SOLR_DEFAULT_CONFIG_SET ?= search_api_solr_4.3.3
ifneq ($(STABILITY_TAG),)
ifneq ($(TAG),latest)
override TAG := $(TAG)-$(STABILITY_TAG)
endif
endif
.PHONY: build test push shell run start stop logs clean release
build:
git checkout -- configsets
VERSION=$(VERSION) scripts/prepare_configsets.sh
docker build -t $(BUILD_IMAGE_TAG) --build-arg FROM=$(FROM) --build-arg VERSION=$(VERSION) --build-arg SOLR_DEFAULT_CONFIG_SET=$(SOLR_DEFAULT_CONFIG_SET) .
test:
IMAGE=$(BUILD_IMAGE_TAG) NAME=$(NAME) VERSION=$(VERSION) ./tests/test.bats
push:
$(DOCKER) push $(BUILD_IMAGE_TAG)
shell: clean
$(DOCKER) run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) /bin/bash
run: clean
$(DOCKER) run --rm --name $(NAME) -it -d $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG)
start: clean
$(DOCKER) run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG)
exec:
$(DOCKER) exec $(NAME) /bin/bash -c "$(CMD)"
stop:
$(DOCKER) stop $(NAME)
logs:
$(DOCKER) logs $(NAME)
clean:
$(DOCKER) rm -f $(NAME) >/dev/null 2>&1 || true
release: build push
default: build