48 lines
1.2 KiB
Makefile
48 lines
1.2 KiB
Makefile
REPO ?= walkero/agate-gemini
|
|
TAG ?= 1.0
|
|
NAME ?= agate-gemini
|
|
WORKSPACE ?= -w /home/gemini/content
|
|
VOLUMES ?= -v "${PWD}/content":/home/gemini/content
|
|
PORTS ?= -p 1965:1965
|
|
|
|
.PHONY: build buildnc shell push logs clean test release
|
|
|
|
default: help
|
|
|
|
help:
|
|
@echo "This makefile helps on building agate Gemini server"
|
|
@echo "The available parameters can be seen below:"
|
|
@echo ""
|
|
@echo "build - Build the Docker image"
|
|
@echo "buildnc - Pull the latest repos' code and build the Docker image"
|
|
@echo " without using caching"
|
|
@echo "shell - Create a container with the latest Docker image and get"
|
|
@echo " into it"
|
|
@echo "clean - Remove the docker container, if this still exists."
|
|
@echo ""
|
|
|
|
build:
|
|
docker build -f ./Dockerfile \
|
|
-t $(REPO):$(TAG) .
|
|
|
|
buildnc: pullrepos
|
|
docker build --no-cache -f ./Dockerfile \
|
|
-t $(REPO):$(TAG) .
|
|
|
|
shell:
|
|
docker run -it --rm --name $(NAME) $(VOLUMES) $(WORKSPACE) $(PORTS) $(REPO):$(TAG) /bin/bash
|
|
|
|
push:
|
|
docker push $(REPO):$(TAG)
|
|
|
|
logs:
|
|
docker logs $(NAME)
|
|
|
|
clean:
|
|
-docker rm -f $(NAME)
|
|
|
|
test:
|
|
snyk test --docker $(REPO):$(TAG) --file=Dockerfile
|
|
|
|
release: build push
|