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 <[email protected]>
  • Loading branch information
Jack12816 committed Oct 21, 2024
1 parent 64b129e commit d63c5ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions 18.01/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CANONICAL_NAME ?= ejabberd
IMAGE_NAME ?= hausgold/$(CANONICAL_NAME)
IMAGE_REF ?= 18.01
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 22.05/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CANONICAL_NAME ?= ejabberd
IMAGE_NAME ?= hausgold/$(CANONICAL_NAME)
IMAGE_REF ?= 22.05
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 d63c5ca

Please sign in to comment.