Skip to content

Commit

Permalink
Updated make file
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-e-dietrich committed Apr 30, 2024
1 parent 3107eac commit 1d610a0
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
-include env_make

# Allow using a different docker binary
DOCKER ?= docker

VERSION ?= 8.1.1
FROM ?= solr:8.1.1-slim
TAG ?= $(VERSION)

REPO ?= docksal/solr
IMAGE ?= docksal/solr
BUILD_IMAGE_TAG ?= $(IMAGE):$(VERSION)-build
NAME = docksal-solr-$(VERSION)
SOLR_DEFAULT_CONFIG_SET ?= search_api_solr_8.x-3.0

Expand All @@ -19,34 +23,34 @@ endif
build:
git checkout -- configsets
VERSION=$(VERSION) scripts/prepare_configsets.sh
docker build -t $(REPO):$(TAG) --build-arg FROM=$(FROM) --build-arg VERSION=$(VERSION) --build-arg SOLR_DEFAULT_CONFIG_SET=$(SOLR_DEFAULT_CONFIG_SET) .
docker build -t $(IMAGE):$(TAG) --build-arg FROM=$(FROM) --build-arg VERSION=$(VERSION) --build-arg SOLR_DEFAULT_CONFIG_SET=$(SOLR_DEFAULT_CONFIG_SET) .

test:
IMAGE=$(REPO):$(TAG) NAME=$(NAME) VERSION=$(VERSION) ./tests/test.bats
IMAGE=$(IMAGE):$(TAG) NAME=$(NAME) VERSION=$(VERSION) ./tests/test.bats

push:
docker push $(REPO):$(TAG)
$(DOCKER) push $(BUILD_IMAGE_TAG)

shell: clean
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG) /bin/bash
$(DOCKER) run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG) /bin/bash

run: clean
docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
$(DOCKER) run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG)

start: clean
docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(TAG)
$(DOCKER) run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(BUILD_IMAGE_TAG)

exec:
docker exec $(NAME) /bin/bash -c "$(CMD)"
$(DOCKER) exec $(NAME) /bin/bash -c "$(CMD)"

stop:
docker stop $(NAME)
$(DOCKER) stop $(NAME)

logs:
docker logs $(NAME)
$(DOCKER) logs $(NAME)

clean:
docker rm -f $(NAME) >/dev/null 2>&1 || true
$(DOCKER) rm -f $(NAME) >/dev/null 2>&1 || true

release: build push

Expand Down

0 comments on commit 1d610a0

Please sign in to comment.