markdownlint-docker/Makefile

53 lines
2.3 KiB
Makefile
Raw Normal View History

2021-09-08 16:03:13 +00:00
# MARKDOWNLINT_VERSION
# Only required to install a specifiy version
MARKDOWNLINT_VERSION?=v0.41.0 # renovate: datasource=github-releases depName=igorshubovych/markdownlint-cli
2021-09-08 16:03:13 +00:00
# CONTAINER_RUNTIME
# The CONTAINER_RUNTIME variable will be used to specified the path to a
# container runtime. This is needed to start and run a container image.
2022-07-18 08:26:50 +00:00
CONTAINER_RUNTIME?=$(shell which podman)
2021-09-08 16:03:13 +00:00
# MARKDOWNLINT_IMAGE_REGISTRY_NAME
# Defines the name of the new container to be built using several variables.
2023-12-09 14:09:20 +00:00
MARKDOWNLINT_IMAGE_REGISTRY_NAME:=git.cryptic.systems
MARKDOWNLINT_IMAGE_REGISTRY_USER:=volker.raschek
2021-09-08 16:03:13 +00:00
MARKDOWNLINT_IMAGE_NAMESPACE?=${MARKDOWNLINT_IMAGE_REGISTRY_USER}
MARKDOWNLINT_IMAGE_NAME:=markdownlint
MARKDOWNLINT_IMAGE_VERSION?=latest
MARKDOWNLINT_IMAGE_FULLY_QUALIFIED=${MARKDOWNLINT_IMAGE_REGISTRY_NAME}/${MARKDOWNLINT_IMAGE_NAMESPACE}/${MARKDOWNLINT_IMAGE_NAME}:${MARKDOWNLINT_IMAGE_VERSION}
MARKDOWNLINT_IMAGE_UNQUALIFIED=${MARKDOWNLINT_IMAGE_NAMESPACE}/${MARKDOWNLINT_IMAGE_NAME}:${MARKDOWNLINT_IMAGE_VERSION}
# BUILD CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/build
container-image/build:
${CONTAINER_RUNTIME} build \
--build-arg MARKDOWNLINT_VERSION=${MARKDOWNLINT_VERSION} \
--file Dockerfile \
--no-cache \
--pull \
--tag ${MARKDOWNLINT_IMAGE_FULLY_QUALIFIED} \
--tag ${MARKDOWNLINT_IMAGE_UNQUALIFIED} \
.
# DELETE CONTAINER IMAGE
# ==============================================================================
PHONY:=container-image/delete
container-image/delete:
- ${CONTAINER_RUNTIME} image rm ${MARKDOWNLINT_IMAGE_FULLY_QUALIFIED} ${MARKDOWNLINT_IMAGE_UNQUALIFIED}
- ${CONTAINER_RUNTIME} image rm ${BASE_IMAGE_FULL}
# PUSH CONTAINER IMAGE
# ==============================================================================
PHONY+=container-image/push
container-image/push:
echo ${MARKDOWNLINT_IMAGE_REGISTRY_PASSWORD} | ${CONTAINER_RUNTIME} login ${MARKDOWNLINT_IMAGE_REGISTRY_NAME} --username ${MARKDOWNLINT_IMAGE_REGISTRY_USER} --password-stdin
${CONTAINER_RUNTIME} push ${MARKDOWNLINT_IMAGE_FULLY_QUALIFIED}
# PHONY
# ==============================================================================
# Declare the contents of the PHONY variable as phony. We keep that information
# in a variable so we can use it in if_changed.
2023-12-09 14:09:20 +00:00
.PHONY: ${PHONY}