-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
37 lines (30 loc) · 1.24 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
DOCKER ?= docker
SOLR_IMAGE ?= solr:8.8
SOLR_CLOUD_NAME ?= solrcloud
SOLR_NAME ?= solr
.PHONY: unit-test
unit-test:
go test -v -cover
.PHONY: integration-test
integration-test:
go test -tags integration -v -cover
.PHONY: solr
solr: rm-solr
$(DOCKER) run -d -p 8983:8983 --name $(SOLR_NAME) $(SOLR_IMAGE) solr -f
$(DOCKER) cp fixtures/security.json $(SOLR_NAME):/var/solr/data/security.json
$(DOCKER) exec -t $(SOLR_NAME) bash -c 'sleep 5; wait-for-solr.sh --max-attempts 10 --wait-seconds 5'
$(DOCKER) exec -t $(SOLR_NAME) bash -c 'SOLR_AUTH_TYPE="basic" SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks" solr create -c searchengines'
.PHONY: solrcloud
solrcloud: rm-solrcloud
$(DOCKER) run -d -p 8984:8983 --name $(SOLR_CLOUD_NAME) $(SOLR_IMAGE) solr -c -f
$(DOCKER) cp fixtures/security.json $(SOLR_CLOUD_NAME):/tmp/security.json
$(DOCKER) exec -t $(SOLR_CLOUD_NAME) bash -c 'solr zk cp file:/tmp/security.json zk:/security.json -z localhost:9983'
$(DOCKER) exec -t $(SOLR_CLOUD_NAME) bash -c 'sleep 5; wait-for-solr.sh --max-attempts 10 --wait-seconds 5'
.PHONY: rm-solrcloud
rm-solrcloud:
$(DOCKER) rm -f $(SOLR_CLOUD_NAME) || true
.PHONY: rm-solr
rm-solr:
$(DOCKER) rm -f $(SOLR_NAME) || true
.PHONY: cleanup
cleanup: rm-solr rm-solrcloud