Skip to content

Commit

Permalink
Improved the local build process.
Browse files Browse the repository at this point in the history
Signed-off-by: Hermann Mayer <hermann.mayer92@gmail.com>
  • Loading branch information
Jack12816 committed Oct 21, 2024
1 parent d25760d commit fad2fc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions 6.2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CANONICAL_NAME ?= redis
IMAGE_NAME ?= hausgold/$(CANONICAL_NAME)
IMAGE_REF ?= 6.2
IMAGE_URI := $(IMAGE_NAME):$(IMAGE_REF)
TEST_CONTAINER_NAME ?= $(CANONICAL_NAME)-test

# Host binaries
CURL ?= curl
Expand Down Expand Up @@ -44,7 +43,7 @@ all:

build: clean
# Build the Docker image
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_NAME):dev" .
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_URI)" .

test:
# Test the built Docker image
Expand All @@ -53,13 +52,12 @@ test:

publish:
# Push the new Docker image to the registry
@$(DOCKER) tag "$(IMAGE_NAME):dev" "$(IMAGE_URI)"
@$(call retry,$(TIME) $(SHELL) -c '$(DOCKER) push $(IMAGE_URI)')

shell:
# Start an individual test session of the image
@$(DOCKER) run --rm -it "$(IMAGE_NAME):dev" bash
@$(DOCKER) run --rm -it "$(IMAGE_URI)" bash

clean:
# Clean the current development snapshot
@$(DOCKER) rmi --force "$(IMAGE_NAME):dev" || true
@$(DOCKER) rmi --force "$(IMAGE_URI)" || true
8 changes: 3 additions & 5 deletions 7.0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CANONICAL_NAME ?= redis
IMAGE_NAME ?= hausgold/$(CANONICAL_NAME)
IMAGE_REF ?= 7.0
IMAGE_URI := $(IMAGE_NAME):$(IMAGE_REF)
TEST_CONTAINER_NAME ?= $(CANONICAL_NAME)-test

# Host binaries
CURL ?= curl
Expand Down Expand Up @@ -44,7 +43,7 @@ all:

build: clean
# Build the Docker image
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_NAME):dev" .
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_URI)" .

test:
# Test the built Docker image
Expand All @@ -53,13 +52,12 @@ test:

publish:
# Push the new Docker image to the registry
@$(DOCKER) tag "$(IMAGE_NAME):dev" "$(IMAGE_URI)"
@$(call retry,$(TIME) $(SHELL) -c '$(DOCKER) push $(IMAGE_URI)')

shell:
# Start an individual test session of the image
@$(DOCKER) run --rm -it "$(IMAGE_NAME):dev" bash
@$(DOCKER) run --rm -it "$(IMAGE_URI)" bash

clean:
# Clean the current development snapshot
@$(DOCKER) rmi --force "$(IMAGE_NAME):dev" || true
@$(DOCKER) rmi --force "$(IMAGE_URI)" || true
8 changes: 3 additions & 5 deletions 7.2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CANONICAL_NAME ?= redis
IMAGE_NAME ?= hausgold/$(CANONICAL_NAME)
IMAGE_REF ?= 7.2
IMAGE_URI := $(IMAGE_NAME):$(IMAGE_REF)
TEST_CONTAINER_NAME ?= $(CANONICAL_NAME)-test

# Host binaries
CURL ?= curl
Expand Down Expand Up @@ -44,7 +43,7 @@ all:

build: clean
# Build the Docker image
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_NAME):dev" .
@$(TIME) $(DOCKER) build --no-cache -t "$(IMAGE_URI)" .

test:
# Test the built Docker image
Expand All @@ -53,13 +52,12 @@ test:

publish:
# Push the new Docker image to the registry
@$(DOCKER) tag "$(IMAGE_NAME):dev" "$(IMAGE_URI)"
@$(call retry,$(TIME) $(SHELL) -c '$(DOCKER) push $(IMAGE_URI)')

shell:
# Start an individual test session of the image
@$(DOCKER) run --rm -it "$(IMAGE_NAME):dev" bash
@$(DOCKER) run --rm -it "$(IMAGE_URI)" bash

clean:
# Clean the current development snapshot
@$(DOCKER) rmi --force "$(IMAGE_NAME):dev" || true
@$(DOCKER) rmi --force "$(IMAGE_URI)" || true

0 comments on commit fad2fc2

Please sign in to comment.