Skip to content

Commit

Permalink
Makefile: Clarify, add docker-release targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ix5 committed Apr 23, 2024
1 parent d4dc6e4 commit ba7c6d5
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ APIDOC = npx --no-install apidoc

SASS = sassc

ISSO_IMAGE ?= isso:latest
ISSO_RELEASE_IMAGE ?= isso:release
ISSO_DOCKER_REGISTRY ?= ghcr.io/isso-comments
TESTBED_IMAGE ?= isso-js-testbed:latest

all: js site
Expand Down Expand Up @@ -93,21 +96,35 @@ test: $($ISSO_PY_SRC)
PYTHONPATH=. pytest --doctest-modules isso/

docker:
DOCKER_BUILDKIT=1 docker build -t isso:latest .
DOCKER_BUILDKIT=1 docker build -t $(ISSO_IMAGE) .

# For maintainers making releases only:
docker-release:
DOCKER_BUILDKIT=1 docker build -t $(ISSO_IMAGE) .

docker-run:
docker run -d --rm --name isso -p 127.0.0.1:8080:8080 --mount type=bind,source=$(PWD)/contrib/isso-dev.cfg,target=/config/isso.cfg,readonly isso:latest isso.run
docker run -d --rm --name isso -p 127.0.0.1:8080:8080 \
--mount type=bind,source=$(PWD)/contrib/isso-dev.cfg,target=/config/isso.cfg,readonly \
$(ISSO_IMAGE) isso.run

# For maintainers only, discouraged in favor of the GitHub action running on
# every git push
docker-push:
docker tag isso:latest ghcr.io/isso-comments/isso:dev
docker push ghcr.io/isso-comments/isso:dev
docker tag $(ISSO_IMAGE) $(ISSO_DOCKER_REGISTRY)/$(ISSO_IMAGE)
docker push $(ISSO_DOCKER_REGISTRY)/$(ISSO_IMAGE)

# For maintainers making releases only:
docker-release-push:
docker tag $(ISSO_RELEASE_IMAGE) $(ISSO_DOCKER_REGISTRY)/$(ISSO_RELEASE_IMAGE)
docker push $(ISSO_DOCKER_REGISTRY)/$(ISSO_RELEASE_IMAGE)

docker-testbed:
docker build -f docker/Dockerfile-js-testbed -t isso-js-testbed .
docker build -f docker/Dockerfile-js-testbed -t $(TESTBED_IMAGE) .

# For maintainers only:
docker-testbed-push:
docker tag isso-js-testbed:latest ghcr.io/isso-comments/isso-js-testbed:latest
docker push ghcr.io/isso-comments/isso-js-testbed:latest
docker tag $(TESTBED_IMAGE) $(ISSO_DOCKER_REGISTRY)/$(TESTBED_IMAGE)
docker push $(ISSO_DOCKER_REGISTRY)/$(TESTBED_IMAGE)

docker-js-unit:
docker run \
Expand Down Expand Up @@ -150,4 +167,4 @@ clean:
rm -rf .pytest_cache/
rm -rf .coverage

.PHONY: apidoc apidoc-init clean coverage docker docker-compare-screenshots docker-generate-screenshots docker-update-screenshots docker-js-unit docker-js-integration docker-push docker-testbed docker-testbed-push init test
.PHONY: apidoc apidoc-init clean coverage docker docker-compare-screenshots docker-generate-screenshots docker-js-integration docker-js-unit docker-push docker-release docker-release-push docker-run docker-testbed docker-testbed-push docker-update-screenshots init test

0 comments on commit ba7c6d5

Please sign in to comment.