From ae4228f0f48e3ae943b49a1fd25ce2a6bcee86cd Mon Sep 17 00:00:00 2001 From: actions-bot Date: Wed, 21 Dec 2022 11:47:48 +0000 Subject: [PATCH] Update configuration --- composer.lock | 60 +++++++++++++++++++++---------------------- tools/make/Makefile | 17 ------------ tools/make/common.mk | 3 ++- tools/make/docker.mk | 12 ++++----- tools/make/drupal.mk | 11 ++++++-- tools/make/include.mk | 23 +++++++++++++++++ tools/make/kubectl.mk | 3 +-- 7 files changed, 71 insertions(+), 58 deletions(-) diff --git a/composer.lock b/composer.lock index ee4a5781..7ef11fc0 100644 --- a/composer.lock +++ b/composer.lock @@ -4063,16 +4063,16 @@ }, { "name": "drupal/hdbt", - "version": "4.3.7", + "version": "4.3.8", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "ced6870c099b2c1d52be3e3bb8a095a502238644" + "reference": "fd9c4874f3d0cffc31aa1ef410553c1ac919d52c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/ced6870c099b2c1d52be3e3bb8a095a502238644", - "reference": "ced6870c099b2c1d52be3e3bb8a095a502238644", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/fd9c4874f3d0cffc31aa1ef410553c1ac919d52c", + "reference": "fd9c4874f3d0cffc31aa1ef410553c1ac919d52c", "shasum": "" }, "require": { @@ -4087,10 +4087,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/4.3.7", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/4.3.8", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2022-12-14T08:23:01+00:00" + "time": "2022-12-19T07:23:20+00:00" }, { "name": "drupal/hdbt_admin", @@ -4126,16 +4126,16 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.3.6", + "version": "2.3.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "f25f99abb17896c15531b4834f0908ba560437bd" + "reference": "bbf138db7bac7701097881a36832288ae809bf7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/f25f99abb17896c15531b4834f0908ba560437bd", - "reference": "f25f99abb17896c15531b4834f0908ba560437bd", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/bbf138db7bac7701097881a36832288ae809bf7f", + "reference": "bbf138db7bac7701097881a36832288ae809bf7f", "shasum": "" }, "require": { @@ -4158,10 +4158,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.3.6", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.3.7", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2022-11-28T07:46:25+00:00" + "time": "2022-12-21T10:10:38+00:00" }, { "name": "drupal/helfi_azure_fs", @@ -4290,16 +4290,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "2.15.6", + "version": "2.15.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "fade6389685f17868355a129f6872f50b75a81b4" + "reference": "b8aab9417f30f74583ff6c6b8d9f7b62c4607f71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/fade6389685f17868355a129f6872f50b75a81b4", - "reference": "fade6389685f17868355a129f6872f50b75a81b4", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/b8aab9417f30f74583ff6c6b8d9f7b62c4607f71", + "reference": "b8aab9417f30f74583ff6c6b8d9f7b62c4607f71", "shasum": "" }, "require": { @@ -4405,10 +4405,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/2.15.6", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/2.15.7", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2022-12-13T10:13:24+00:00" + "time": "2022-12-19T15:50:39+00:00" }, { "name": "drupal/helfi_proxy", @@ -15568,16 +15568,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.15.0", + "version": "1.15.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6ff970a7101acfe99b3048e4bbfbc094e55c5b04" + "reference": "61800f71a5526081d1b5633766aa88341f1ade76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ff970a7101acfe99b3048e4bbfbc094e55c5b04", - "reference": "6ff970a7101acfe99b3048e4bbfbc094e55c5b04", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76", "shasum": "" }, "require": { @@ -15607,9 +15607,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.3" }, - "time": "2022-12-07T16:12:39+00:00" + "time": "2022-12-20T20:56:55+00:00" }, { "name": "phpstan/phpstan", @@ -15722,16 +15722,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -15787,7 +15787,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -15795,7 +15795,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/tools/make/Makefile b/tools/make/Makefile index 19f1cf97..ce10ca6f 100644 --- a/tools/make/Makefile +++ b/tools/make/Makefile @@ -12,23 +12,6 @@ UNAME_S := $(shell uname -s) UPDATE_SCRIPT_URL := https://git.io/JP10q WEBROOT ?= public -# Detect app -IS_DRUPAL ?= $(shell test -f $(WEBROOT)/sites/default/settings.php && echo yes || echo no) -IS_SYMFONY ?= $(shell test -f config/bundles.php && echo yes || echo no) -IS_WP ?= $(shell (test -f $(WEBROOT)/wp-settings.php || test -f conf/wp-config.php) && echo yes || echo no) - -# Detect additional tooling -LAGOON := $(shell test -f .lagoon.yml && echo yes || echo no) -WODBY := $(shell test -f wodby.yml && echo yes || echo no) - -ifeq ($(LAGOON),yes) - SYSTEM := LAGOON -else ifeq ($(WODBY),yes) - SYSTEM := WODBY -else - SYSTEM := WHOKNOWS -endif - include $(DRUIDFI_TOOLS_MAKE_DIR)utils.mk # Include druidfi/tools make files diff --git a/tools/make/common.mk b/tools/make/common.mk index 55b972a0..fe000103 100644 --- a/tools/make/common.mk +++ b/tools/make/common.mk @@ -40,7 +40,8 @@ build-production: PHONY += clean clean: ## Cleanup - $(call step,Do Git clean\n) + $(call step,Cleanup loaded files...\n) + @rm -rf vendor @git clean -fdx $(foreach item,$(CLEAN_EXCLUDE),-e $(item)) PHONY += self-update diff --git a/tools/make/docker.mk b/tools/make/docker.mk index 89014bcf..9ddde12b 100644 --- a/tools/make/docker.mk +++ b/tools/make/docker.mk @@ -1,7 +1,7 @@ CLI_SERVICE := cli CLI_SHELL := sh CLI_USER := root -DOCKER_COMPOSE := docker-compose +DOCKER_COMPOSE := docker compose DOCKER_COMPOSE_EXEC ?= $(DOCKER_COMPOSE) exec DOCKER_COMPOSE_YML_PATH ?= docker-compose.yml DOCKER_COMPOSE_YML_EXISTS := $(shell test -f $(DOCKER_COMPOSE_YML_PATH) && echo yes || echo no) @@ -15,7 +15,7 @@ endif PHONY += config config: ## Show docker-compose config - $(call step,Show docker-compose config...\n) + $(call step,Show Docker Compose config...\n) $(call docker_compose,config) PHONY += pull @@ -29,8 +29,8 @@ down: ## Tear down the environment $(call docker_compose,down -v --remove-orphans --rmi local) PHONY += ps -ps: ## Show docker-compose ps - $(call step,Show docker-compose ps...\n) +ps: ## List containers + $(call step,List container(s)...\n) $(call docker_compose,ps) PHONY += stop @@ -39,9 +39,9 @@ stop: ## Stop the environment $(call docker_compose,stop) PHONY += up -up: pull ## Launch the environment +up: ## Launch the environment $(call step,Start up the container(s)...\n) - $(call docker_compose,up -d --remove-orphans) + $(call docker_compose,up -d --pull always --wait --remove-orphans) PHONY += shell shell: ## Login to CLI container diff --git a/tools/make/drupal.mk b/tools/make/drupal.mk index 44721390..c5aaa881 100644 --- a/tools/make/drupal.mk +++ b/tools/make/drupal.mk @@ -8,7 +8,7 @@ DRUPAL_DISABLE_MODULES ?= no DRUPAL_ENABLE_MODULES ?= no DRUPAL_PROFILE ?= minimal DRUPAL_SYNC_FILES ?= yes -DRUPAL_SYNC_SOURCE ?= production +DRUPAL_SYNC_SOURCE ?= main DRUSH_RSYNC_MODE ?= Pakzu DRUSH_RSYNC_OPTS ?= -- --omit-dir-times --no-perms --no-group --no-owner --chmod=ugo=rwX DRUSH_RSYNC_EXCLUDE ?= css:ctools:js:php:tmp:tmp_php @@ -38,6 +38,7 @@ endif PHONY += drupal-create-folders drupal-create-folders: + @mkdir -p $(WEBROOT)/sites/default/files/private @mkdir -p $(WEBROOT)/sites/default/files/translations PHONY += drupal-update @@ -157,7 +158,7 @@ drush-create-dump: ## Create database dump to dump.sql PHONY += drush-download-dump drush-download-dump: ## Download database dump to dump.sql - $(call drush,-Dssh.tty=0 @$(DRUPAL_SYNC_SOURCE) sql-dump --structure-tables-key=common > ${DOCKER_PROJECT_ROOT}/$(DUMP_SQL_FILENAME)) + $(call drush,@$(DRUPAL_SYNC_SOURCE) sql-dump --structure-tables-key=common > ${DOCKER_PROJECT_ROOT}/$(DUMP_SQL_FILENAME)) PHONY += open-db-gui open-db-gui: DB_CONTAINER := $(COMPOSE_PROJECT_NAME)-db @@ -172,6 +173,12 @@ fix-drupal: ## Fix Drupal code style $(call step,Fix Drupal code style with phpcbf...\n) $(call cs,phpcbf,$(PATHS)) +PHONY += fix-drupal-coder +fix-drupal-coder: VERSION := 8.3.16 +fix-drupal-coder: ## Fix Drupal Coder loading + composer config repositories.drupal '{"type": "composer", "url": "https://packages.drupal.org/8"}' + composer config repositories.drupal/coder '{"type": "package", "package": {"name": "drupal/coder", "type": "phpcodesniffer-standard", "version": "$(VERSION)", "dist": {"type": "zip", "url": "https://ftp.drupal.org/files/projects/coder-$(VERSION).zip"}}}' + PHONY += lint-drupal lint-drupal: PATHS := $(subst $(space),,$(LINT_PATHS_PHP)) lint-drupal: ## Lint Drupal code style diff --git a/tools/make/include.mk b/tools/make/include.mk index d69a4665..2216bc1f 100644 --- a/tools/make/include.mk +++ b/tools/make/include.mk @@ -6,6 +6,14 @@ endif include $(DRUIDFI_TOOLS_MAKE_DIR)qa.mk +# +# Apps +# + +IS_DRUPAL ?= $(shell test -f $(WEBROOT)/sites/default/settings.php && echo yes || echo no) +IS_SYMFONY ?= $(shell test -f config/bundles.php && echo yes || echo no) +IS_WP ?= $(shell (test -f $(WEBROOT)/wp-settings.php || test -f conf/wp-config.php) && echo yes || echo no) + ifeq ($(IS_DRUPAL),yes) include $(DRUIDFI_TOOLS_MAKE_DIR)drupal.mk endif @@ -18,6 +26,21 @@ ifeq ($(IS_WP),yes) include $(DRUIDFI_TOOLS_MAKE_DIR)wordpress.mk endif +# +# Hosting systems +# + +LAGOON := $(shell test -f .lagoon.yml && echo yes || echo no) +WODBY := $(shell test -f wodby.yml && echo yes || echo no) + +ifeq ($(LAGOON),yes) + SYSTEM := LAGOON +else ifeq ($(WODBY),yes) + SYSTEM := WODBY +else + SYSTEM := WHOKNOWS +endif + ifeq ($(SYSTEM),LAGOON) include $(DRUIDFI_TOOLS_MAKE_DIR)lagoon.mk endif diff --git a/tools/make/kubectl.mk b/tools/make/kubectl.mk index 6f538f8d..e4f3c604 100644 --- a/tools/make/kubectl.mk +++ b/tools/make/kubectl.mk @@ -3,7 +3,6 @@ KUBECTL_NAMESPACE ?= foobar-namespace KUBECTL_SHELL ?= sh KUBECTL_EXEC_FLAGS ?= -n $(KUBECTL_NAMESPACE) -c $(KUBECTL_CONTAINER) KUBECTL_WORKDIR ?= /app -KUBECTL_POD_SELECTOR ?= --field-selector=status.phase==Running PHONY += kubectl-sync-db kubectl-sync-db: ## Sync database from Kubernetes @@ -48,5 +47,5 @@ define kubectl_cp endef define kubectl_get_pod - $(shell $(KUBECTL_BIN) get pods -n $(KUBECTL_NAMESPACE) $(KUBECTL_POD_SELECTOR) -o jsonpath="{.items[0].metadata.name}") + $(shell $(KUBECTL_BIN) get pods -n $(KUBECTL_NAMESPACE) --template '{{range .items}}{{ if not .metadata.deletionTimestamp }}{{.metadata.name}}{{"\n"}}{{end}}{{end}}') endef