bump docker compose minimal version
This commit is contained in:
@@ -13,7 +13,7 @@ COMPOSE_FILE_WWW ?= false
|
||||
COMPOSE_IGNORE_ORPHANS ?= false
|
||||
COMPOSE_PROJECT_NAME ?= $(if $(DOCKER_COMPOSE_PROJECT_NAME),$(DOCKER_COMPOSE_PROJECT_NAME),$(subst .,,$(call LOWERCASE,$(USER)-$(APP_NAME)-$(ENV)$(addprefix -,$(subst /,,$(subst -,,$(APP_PATH)))))))
|
||||
COMPOSE_SERVICE_NAME ?= $(if $(DOCKER_COMPOSE_SERVICE_NAME),$(DOCKER_COMPOSE_SERVICE_NAME),$(subst _,-,$(COMPOSE_PROJECT_NAME)))
|
||||
COMPOSE_VERSION ?= 2.5.0
|
||||
COMPOSE_VERSION ?= 2.24.4
|
||||
CONTEXT += COMPOSE_FILE DOCKER_REPOSITORY
|
||||
CONTEXT_DEBUG += DOCKER_BUILD_TARGET DOCKER_COMPOSE_PROJECT_NAME DOCKER_IMAGE_TAG DOCKER_REGISTRY DOCKER_SERVICE DOCKER_SERVICES
|
||||
DOCKER_AUTHOR ?= $(DOCKER_AUTHOR_NAME) <$(DOCKER_AUTHOR_EMAIL)>
|
||||
@@ -27,7 +27,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 COMPOSE_VERSION DOCKER_GID DOCKER_MACHINE DOCKER_REPOSITORY DOCKER_SYSTEM GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME SSH_REMOTE_HOSTS USER VERSION
|
||||
DOCKER_COMPOSE ?= $(or $(shell docker-compose --version 2>/dev/null |awk '$$4 != "v'"$(COMPOSE_VERSION)"'" {exit 1} END {if (NR == 0) exit 1}' && printf 'docker-compose\n'),$(shell docker compose >/dev/null 2>&1 && printf 'docker compose\n'))
|
||||
DOCKER_COMPOSE ?= $(or $(shell $(call verle,$(COMPOSE_VERSION),$(shell docker compose version --short 2>/dev/null)) && printf 'docker compose\n'),$(shell $(call verle,$(COMPOSE_VERSION),$(shell docker-compose version --short 2>/dev/null)) && printf 'docker-compose\n'))
|
||||
DOCKER_COMPOSE_ARGS ?= --ansi=auto
|
||||
DOCKER_COMPOSE_DOWN_OPTIONS ?=
|
||||
DOCKER_COMPOSE_FILE ?= docker-compose
|
||||
@@ -72,7 +72,7 @@ define compose-file
|
||||
$(eval name := $(or $(2),$(DOCKER_COMPOSE_FILE)))
|
||||
$(eval suffix := $(or $(3),$(COMPOSE_FILE_SUFFIX)))
|
||||
$(eval extension := $(or $(4),yml yaml))
|
||||
$(eval COMPOSE_FILE += $(wildcard $(foreach e,$(extension),$(foreach n,$(name),$(foreach p,$(path),$(p)/$(n).$(e) $(p)/$(n).$(ENV).$(e) $(foreach s,$(suffix),$(p)/$(n).$(s).$(e) $(p)/$(n).$(s).$(ENV).$(e)))))))
|
||||
$(eval COMPOSE_FILE += $(wildcard $(foreach e,$(extension),$(foreach n,$(name),$(foreach p,$(path),$(p)/$(n).$(e) $(p)/$(n).$(ENV).$(e) $(p)/$(ENV)/$(n).$(e) $(p)/$(ENV)/$(n).$(ENV).$(e) $(foreach s,$(suffix),$(p)/$(n).$(s).$(e) $(p)/$(n).$(s).$(ENV).$(e)))))))
|
||||
endef
|
||||
# function docker-build: Build docker image
|
||||
define docker-build
|
||||
@@ -148,7 +148,7 @@ define docker-stack-update
|
||||
$(eval name := $(firstword $(subst :, ,$(stack))))
|
||||
$(eval version := $(or $(2),$(if $(findstring :,$(stack)),$(lastword $(subst :, ,$(stack))),latest)))
|
||||
$(eval path := $(patsubst %/,%,$(or $(3),$(if $(findstring /,$(1)),$(if $(wildcard stack/$(1) stack/$(1).yml),stack/$(if $(findstring .yml,$(1)),$(dir $(1)),$(if $(wildcard stack/$(1).yml),$(dir $(1)),$(1))),$(if $(wildcard stack/$(stackz)/$(1) stack/$(stackz)/$(1).yml),stack/$(stackz)/$(if $(findstring .yml,$(1)),$(dir $(1)),$(if $(wildcard stack/$(stackz)/$(1).yml),$(dir $(1)),$(1))),$(dir $(1))))),$(firstword $(wildcard stack/$(stackz)/$(name) stack/$(stackz) stack/$(name))))))
|
||||
$(call compose-file,$(path),$(name),$(COMPOSE_FILE_SUFFIX) $(version))
|
||||
$(call compose-file,$(path),docker-compose $(name),$(COMPOSE_FILE_SUFFIX) $(version))
|
||||
$(if $(wildcard $(path)/.env.dist),$(call .env,,$(path)/.env.dist,$(wildcard $(CONFIG)/$(ENV)/$(APP)/.env $(path)/.env.$(ENV) .env)))
|
||||
endef
|
||||
# function docker-tag: Tag docker image
|
||||
|
||||
@@ -242,6 +242,12 @@ pop = $(patsubst %$(or $(2),/)$(lastword $(subst $(or $(2),/), ,$(1))),%,$(1))
|
||||
# macro sed: Run sed script 1 on file 2
|
||||
sed = $(RUN) sed -i $(SED_SUFFIX) '$(1)' $(2)
|
||||
|
||||
# macro verle: Return true when version 1 <= 2
|
||||
verle = [ -n "$(1)" ] && [ "$(1)" = "$(shell echo -e "$(1)\n$(2)" |sort -V |head -n1)" ]
|
||||
|
||||
# macro verlt: Return true when version 1 < 2
|
||||
verlt = [ "$(1)" = "$(2)" ] && return 1 || $(call verlte,$(1),$(2))
|
||||
|
||||
# function conf: Extract variable=value line from configuration files
|
||||
## it prints the line with variable 3 definition from block 2 in file 1
|
||||
define conf
|
||||
|
||||
Reference in New Issue
Block a user