update docker images
This commit is contained in:
@@ -7,7 +7,7 @@ BUILD_LABEL_VARS ?= org.label-schema.% org.opencontainers.% os.my
|
||||
BUILD_LABEL_ARGS ?= $(foreach var,$(filter $(BUILD_LABEL_VARS),$(MAKE_FILE_VARS)),$(if $($(var)),$(var)='$($(var))'))
|
||||
BUILD_LICENSE ?= GPL-3.0
|
||||
BUILD_NAME ?= $(COMPOSE_SERVICE_NAME)-$(BUILD_SERVICE)
|
||||
BUILD_SERVICE ?= undef
|
||||
BUILD_SERVICE ?= $(or $(service),undefined)
|
||||
BUILD_STATUS ?= $(shell git status -uno --porcelain 2>/dev/null)
|
||||
|
||||
org.label-schema.build-date ?= $(BUILD_DATE)
|
||||
|
||||
@@ -26,6 +26,7 @@ DOCKER_BUILD_TARGET ?= $(if $(filter $(ENV),$(DOCKER_BUILD_TARGETS))
|
||||
DOCKER_BUILD_TARGET_DEFAULT ?= master
|
||||
DOCKER_BUILD_TARGETS ?= $(ENV_DEPLOY)
|
||||
DOCKER_BUILD_VARS ?= APP BRANCH DOCKER_GID DOCKER_REPOSITORY GID GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME SSH_BASTION_HOSTNAME SSH_BASTION_USERNAME SSH_PRIVATE_IP_RANGE SSH_PUBLIC_HOST_KEYS SSH_REMOTE_HOSTS UID USER VERSION
|
||||
DOCKER_COMPOSE ?= $(if $(DOCKER_RUN),docker/compose:$(COMPOSE_VERSION),$(or $(shell docker compose >/dev/null 2>&1 && printf 'docker compose\n'),docker-compose))
|
||||
DOCKER_COMPOSE_DOWN_OPTIONS ?=
|
||||
DOCKER_COMPOSE_UP_OPTIONS ?= -d
|
||||
DOCKER_IMAGE_TAG ?= $(if $(filter $(ENV),$(ENV_DEPLOY)),$(VERSION),$(if $(DRONE_BUILD_NUMBER),$(DRONE_BUILD_NUMBER),latest))
|
||||
@@ -47,12 +48,6 @@ DOCKER_SERVICES ?= $(eval IGNORE_DRYRUN := true)$(shell $(call d
|
||||
DOCKER_SHELL ?= $(SHELL)
|
||||
ENV_VARS += COMPOSE_PROJECT_NAME COMPOSE_SERVICE_NAME DOCKER_BUILD_TARGET DOCKER_IMAGE_TAG DOCKER_REGISTRY DOCKER_REPOSITORY DOCKER_SHELL
|
||||
|
||||
ifneq ($(DOCKER_RUN),)
|
||||
DOCKER_COMPOSE ?= docker/compose:$(COMPOSE_VERSION)
|
||||
else
|
||||
DOCKER_COMPOSE ?= $(or $(shell docker compose >/dev/null 2>&1 && printf 'docker compose\n'),docker-compose)
|
||||
endif
|
||||
|
||||
ifeq ($(DRONE), true)
|
||||
APP_PATH_PREFIX := $(DRONE_BUILD_NUMBER)
|
||||
DOCKER_BUILD_CACHE := false
|
||||
@@ -88,7 +83,8 @@ endef
|
||||
define docker-build
|
||||
$(call INFO,docker-build,$(1)$(comma) $(2)$(comma) $(3))
|
||||
$(eval path := $(patsubst %/,%,$(1)))
|
||||
$(eval tag := $(or $(2),$(DOCKER_REPOSITORY)/$(lastword $(subst /, ,$(path))):$(DOCKER_IMAGE_TAG)))
|
||||
$(eval service := $(lastword $(subst /, ,$(path))))
|
||||
$(eval tag := $(or $(2),$(DOCKER_REPOSITORY)/$(service):$(DOCKER_IMAGE_TAG)))
|
||||
$(eval target := $(subst ",,$(subst ',,$(or $(3),$(DOCKER_BUILD_TARGET)))))
|
||||
$(eval image_id := $(shell docker images -q $(tag) 2>/dev/null))
|
||||
$(eval build_image := $(or $(filter false,$(DOCKER_BUILD_CACHE)),$(if $(image_id),,true)))
|
||||
|
||||
Reference in New Issue
Block a user