From 4049d2cd8cd3ae9f745057ddbe1f600075aa9876 Mon Sep 17 00:00:00 2001 From: actions-bot Date: Mon, 28 Aug 2023 05:39:59 +0000 Subject: [PATCH] Update configuration --- composer.lock | 142 +++++++++--------- ...tities.external_entity_type.helfi_news.yml | 2 +- ...external_entity_type.helfi_news_groups.yml | 2 +- ..._entity_type.helfi_news_neighbourhoods.yml | 2 +- ...s.external_entity_type.helfi_news_tags.yml | 2 +- ...er_add_role_action.super_administrator.yml | 14 ++ ...remove_role_action.super_administrator.yml | 14 ++ conf/cmi/user.role.super_administrator.yml | 9 ++ conf/cmi/views.view.tpr_unit_list.yml | 2 +- docker/openshift/Dockerfile | 9 +- tools/make/include.mk | 5 - tools/make/kubectl.mk | 1 + tools/make/wordpress.mk | 98 ------------ 13 files changed, 120 insertions(+), 182 deletions(-) create mode 100644 conf/cmi/system.action.user_add_role_action.super_administrator.yml create mode 100644 conf/cmi/system.action.user_remove_role_action.super_administrator.yml create mode 100644 conf/cmi/user.role.super_administrator.yml delete mode 100644 tools/make/wordpress.mk diff --git a/composer.lock b/composer.lock index dd9c28a3..8b5cb7ca 100644 --- a/composer.lock +++ b/composer.lock @@ -2654,17 +2654,17 @@ }, { "name": "drupal/editoria11y", - "version": "2.0.13", + "version": "2.0.14", "source": { "type": "git", "url": "https://git.drupalcode.org/project/editoria11y.git", - "reference": "2.0.13" + "reference": "2.0.14" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/editoria11y-2.0.13.zip", - "reference": "2.0.13", - "shasum": "2c1683f0c075918c74f7ccd526f7bc787f260a7f" + "url": "https://ftp.drupal.org/files/projects/editoria11y-2.0.14.zip", + "reference": "2.0.14", + "shasum": "ac0e3d232f3c36e0d7759f1991e08ef767d11acd" }, "require": { "drupal/core": "^9 || ^10" @@ -2672,8 +2672,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.0.13", - "datestamp": "1690052595", + "version": "2.0.14", + "datestamp": "1692130094", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3533,7 +3533,7 @@ "source": { "type": "git", "url": "https://git.drupalcode.org/project/flysystem_azure.git", - "reference": "1f54cbcccaf9a7a609a48353fca78c3bdca71f1d" + "reference": "a29917177083ecb457f524ac8c7ff7e478c697e0" }, "require": { "drupal/core": "^8 || ^9", @@ -3548,7 +3548,7 @@ }, "drupal": { "version": "1.0.x-dev", - "datestamp": "1620053329", + "datestamp": "1692017626", "security-coverage": { "status": "not-covered", "message": "Project has not opted into security advisory coverage!" @@ -3751,16 +3751,16 @@ }, { "name": "drupal/hdbt", - "version": "5.5.2", + "version": "5.5.7", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "cfe43a7f2fe301594299a3b8fd4651d9dbaa3cb4" + "reference": "4a50486997cf28ead79061260a67295a3d801c30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/cfe43a7f2fe301594299a3b8fd4651d9dbaa3cb4", - "reference": "cfe43a7f2fe301594299a3b8fd4651d9dbaa3cb4", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/4a50486997cf28ead79061260a67295a3d801c30", + "reference": "4a50486997cf28ead79061260a67295a3d801c30", "shasum": "" }, "require": { @@ -3778,10 +3778,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.5.2", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/5.5.7", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2023-08-09T07:34:44+00:00" + "time": "2023-08-25T08:38:45+00:00" }, { "name": "drupal/hdbt_admin", @@ -3870,16 +3870,16 @@ }, { "name": "drupal/helfi_api_base", - "version": "2.4.17", + "version": "2.4.19", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base.git", - "reference": "4c3d285d0399b949db2ec6443fdd04937ee22532" + "reference": "917de458ac2ed2b046a9c4125094f3d233c47289" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/4c3d285d0399b949db2ec6443fdd04937ee22532", - "reference": "4c3d285d0399b949db2ec6443fdd04937ee22532", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-api-base/zipball/917de458ac2ed2b046a9c4125094f3d233c47289", + "reference": "917de458ac2ed2b046a9c4125094f3d233c47289", "shasum": "" }, "require": { @@ -3905,10 +3905,10 @@ ], "description": "Helfi - API Base", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.4.17", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/tree/2.4.19", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/issues" }, - "time": "2023-08-04T05:28:12+00:00" + "time": "2023-08-25T05:23:13+00:00" }, { "name": "drupal/helfi_azure_fs", @@ -4011,16 +4011,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "3.3.2", + "version": "3.3.5", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "a44de2707583ec84fce7ddbef86906d00749d239" + "reference": "f950e0a07a2aa99f7c52c29df3b3a65f18bcccc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/a44de2707583ec84fce7ddbef86906d00749d239", - "reference": "a44de2707583ec84fce7ddbef86906d00749d239", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/f950e0a07a2aa99f7c52c29df3b3a65f18bcccc4", + "reference": "f950e0a07a2aa99f7c52c29df3b3a65f18bcccc4", "shasum": "" }, "require": { @@ -4123,23 +4123,23 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.3.2", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/3.3.5", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2023-08-10T06:02:41+00:00" + "time": "2023-08-23T11:08:09+00:00" }, { "name": "drupal/helfi_proxy", - "version": "3.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-module-helfi-proxy.git", - "reference": "f5125c5569c04781730d1420f0d1886ba1096c1f" + "reference": "257e937e6e1d77e8da5ec1ef20f133109b9b1ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-proxy/zipball/f5125c5569c04781730d1420f0d1886ba1096c1f", - "reference": "f5125c5569c04781730d1420f0d1886ba1096c1f", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-module-helfi-proxy/zipball/257e937e6e1d77e8da5ec1ef20f133109b9b1ed4", + "reference": "257e937e6e1d77e8da5ec1ef20f133109b9b1ed4", "shasum": "" }, "require": { @@ -4156,6 +4156,8 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "drupal/coder": "^8.3", + "drupal/helfi_tunnistamo": "*", + "drupal/redirect": "^1.0", "drupal/simple_sitemap": "^4.1", "phpspec/prophecy-phpunit": "^2" }, @@ -4165,10 +4167,10 @@ ], "description": "Provides various fixes so we can serve multiple Drupal instances in one domain.", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-proxy/tree/3.0.4", + "source": "https://github.com/City-of-Helsinki/drupal-module-helfi-proxy/tree/3.0.5", "issues": "https://github.com/City-of-Helsinki/drupal-module-helfi-proxy/issues" }, - "time": "2023-03-14T06:27:48+00:00" + "time": "2023-08-11T05:35:26+00:00" }, { "name": "drupal/helfi_tpr", @@ -4873,17 +4875,17 @@ }, { "name": "drupal/oembed_providers", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/oembed_providers.git", - "reference": "2.1.1" + "reference": "2.1.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/oembed_providers-2.1.1.zip", - "reference": "2.1.1", - "shasum": "d0f87b92528b082d25f8b84b82a84d118fed12e0" + "url": "https://ftp.drupal.org/files/projects/oembed_providers-2.1.2.zip", + "reference": "2.1.2", + "shasum": "ad125c7e55555499f001755c365f96edce1d6343" }, "require": { "drupal/core": "^9.0|^10.0" @@ -4891,8 +4893,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.1.1", - "datestamp": "1683987092", + "version": "2.1.2", + "datestamp": "1692724351", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7431,22 +7433,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -7537,7 +7539,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -7553,7 +7555,7 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", @@ -9754,32 +9756,32 @@ }, { "name": "phrity/net-uri", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sirn-se/phrity-net-uri.git", - "reference": "c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7" + "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7", - "reference": "c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7", + "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/3f458e0c4d1ddc0e218d7a5b9420127c63925f43", + "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43", "shasum": "" }, "require": { - "php": "^7.4|^8.0", + "php": "^7.4 | ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 | ^2.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.0 | ^10.0", "squizlabs/php_codesniffer": "^3.0" }, "type": "library", "autoload": { "psr-4": { - "": "src/" + "Phrity\\Net\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -9803,9 +9805,9 @@ ], "support": { "issues": "https://github.com/sirn-se/phrity-net-uri/issues", - "source": "https://github.com/sirn-se/phrity-net-uri/tree/1.2.0" + "source": "https://github.com/sirn-se/phrity-net-uri/tree/1.3.0" }, - "time": "2022-11-30T07:20:06+00:00" + "time": "2023-08-21T10:33:06+00:00" }, { "name": "phrity/util-errorhandler", @@ -13379,16 +13381,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.26", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e706c99b4a6f4d9383b52b80dd8c74880501e314" + "reference": "684b36ff415e1381d4a943c3ca2502cd2debad73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e706c99b4a6f4d9383b52b80dd8c74880501e314", - "reference": "e706c99b4a6f4d9383b52b80dd8c74880501e314", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/684b36ff415e1381d4a943c3ca2502cd2debad73", + "reference": "684b36ff415e1381d4a943c3ca2502cd2debad73", "shasum": "" }, "require": { @@ -13448,7 +13450,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.26" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.28" }, "funding": [ { @@ -13464,7 +13466,7 @@ "type": "tidelift" } ], - "time": "2023-07-13T07:32:46+00:00" + "time": "2023-08-24T13:38:36+00:00" }, { "name": "symfony/yaml", @@ -15622,16 +15624,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -15674,9 +15676,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" }, - "time": "2023-05-30T18:13:47+00:00" + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpspec/prophecy", diff --git a/conf/cmi/external_entities.external_entity_type.helfi_news.yml b/conf/cmi/external_entities.external_entity_type.helfi_news.yml index ffda3463..0d773f01 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_news.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_news.yml @@ -8,8 +8,8 @@ id: helfi_news label: 'Helfi: News' label_plural: 'Helfi: News' description: '' -generate_aliases: null read_only: true +generate_aliases: null field_mapper_id: jsonpath field_mapper_config: field_mappings: diff --git a/conf/cmi/external_entities.external_entity_type.helfi_news_groups.yml b/conf/cmi/external_entities.external_entity_type.helfi_news_groups.yml index 93c68f1b..a5e96c1f 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_news_groups.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_news_groups.yml @@ -8,8 +8,8 @@ id: helfi_news_groups label: 'Helfi: News groups' label_plural: 'Helfi: News groups' description: 'Retrieves news groups taxonomy terms from Helfi' -generate_aliases: null read_only: true +generate_aliases: null field_mapper_id: jsonpath field_mapper_config: field_mappings: diff --git a/conf/cmi/external_entities.external_entity_type.helfi_news_neighbourhoods.yml b/conf/cmi/external_entities.external_entity_type.helfi_news_neighbourhoods.yml index b5cdd8b2..40197578 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_news_neighbourhoods.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_news_neighbourhoods.yml @@ -8,8 +8,8 @@ id: helfi_news_neighbourhoods label: 'Helfi: News neighbourhoods' label_plural: 'Helfi: News neighbourhoods' description: 'Retrieves news neighbourhoods taxonomy terms from Helfi' -generate_aliases: null read_only: true +generate_aliases: null field_mapper_id: jsonpath field_mapper_config: field_mappings: diff --git a/conf/cmi/external_entities.external_entity_type.helfi_news_tags.yml b/conf/cmi/external_entities.external_entity_type.helfi_news_tags.yml index 23658a6b..573d5c52 100644 --- a/conf/cmi/external_entities.external_entity_type.helfi_news_tags.yml +++ b/conf/cmi/external_entities.external_entity_type.helfi_news_tags.yml @@ -8,8 +8,8 @@ id: helfi_news_tags label: 'Helfi: News tags' label_plural: 'Helfi: News tags' description: 'Retrieves news tags taxonomy terms from Helfi' -generate_aliases: null read_only: true +generate_aliases: null field_mapper_id: jsonpath field_mapper_config: field_mappings: diff --git a/conf/cmi/system.action.user_add_role_action.super_administrator.yml b/conf/cmi/system.action.user_add_role_action.super_administrator.yml new file mode 100644 index 00000000..739d284b --- /dev/null +++ b/conf/cmi/system.action.user_add_role_action.super_administrator.yml @@ -0,0 +1,14 @@ +uuid: c17a53b8-d254-48c2-beb8-f2bdcf1fd740 +langcode: en +status: true +dependencies: + config: + - user.role.super_administrator + module: + - user +id: user_add_role_action.super_administrator +label: 'Add the Super administrator role to the selected user(s)' +type: user +plugin: user_add_role_action +configuration: + rid: super_administrator diff --git a/conf/cmi/system.action.user_remove_role_action.super_administrator.yml b/conf/cmi/system.action.user_remove_role_action.super_administrator.yml new file mode 100644 index 00000000..d0331bc3 --- /dev/null +++ b/conf/cmi/system.action.user_remove_role_action.super_administrator.yml @@ -0,0 +1,14 @@ +uuid: 2db2fc94-a4a0-4320-83fb-a74f63170404 +langcode: en +status: true +dependencies: + config: + - user.role.super_administrator + module: + - user +id: user_remove_role_action.super_administrator +label: 'Remove the Super administrator role from the selected user(s)' +type: user +plugin: user_remove_role_action +configuration: + rid: super_administrator diff --git a/conf/cmi/user.role.super_administrator.yml b/conf/cmi/user.role.super_administrator.yml new file mode 100644 index 00000000..4f8d8ab9 --- /dev/null +++ b/conf/cmi/user.role.super_administrator.yml @@ -0,0 +1,9 @@ +uuid: 8e600f56-ec0e-428a-b77c-e9d0922dfa98 +langcode: en +status: true +dependencies: { } +id: super_administrator +label: 'Super administrator' +weight: 7 +is_admin: true +permissions: { } diff --git a/conf/cmi/views.view.tpr_unit_list.yml b/conf/cmi/views.view.tpr_unit_list.yml index 5b4d58a7..261d79f0 100644 --- a/conf/cmi/views.view.tpr_unit_list.yml +++ b/conf/cmi/views.view.tpr_unit_list.yml @@ -76,6 +76,7 @@ display: batch: true batch_size: 50 form_step: true + ajax_loader: false buttons: false action_title: Action clear_on_exposed: true @@ -107,7 +108,6 @@ display: preconfiguration: add_confirmation: false label_override: 'Publish unit' - ajax_loader: false id: id: id table: tpr_unit_field_data diff --git a/docker/openshift/Dockerfile b/docker/openshift/Dockerfile index 16e12dea..25b26fa5 100644 --- a/docker/openshift/Dockerfile +++ b/docker/openshift/Dockerfile @@ -1,13 +1,14 @@ -ARG DRUPAL_DOCKER_TAG=8.1 +ARG DRUPAL_DOCKER_TAG=8.2 FROM ghcr.io/city-of-helsinki/drupal-docker-base:${DRUPAL_DOCKER_TAG} COPY / /var/www/html/ WORKDIR /var/www/html RUN composer install --no-progress --profile --prefer-dist --no-interaction --no-dev --optimize-autoloader -# Copy deploy script -COPY docker/openshift/entrypoints/20-deploy.sh /entrypoints -RUN chmod +x /entrypoints/20-deploy.sh +# Copy ALL deploy scripts +COPY docker/openshift/entrypoints/ /entrypoints +RUN chmod +x /entrypoints/* + # Copy cron scripts RUN mkdir /crons diff --git a/tools/make/include.mk b/tools/make/include.mk index 2216bc1f..cf95f4d5 100644 --- a/tools/make/include.mk +++ b/tools/make/include.mk @@ -12,7 +12,6 @@ include $(DRUIDFI_TOOLS_MAKE_DIR)qa.mk 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 @@ -22,10 +21,6 @@ ifeq ($(IS_SYMFONY),yes) include $(DRUIDFI_TOOLS_MAKE_DIR)symfony.mk endif -ifeq ($(IS_WP),yes) -include $(DRUIDFI_TOOLS_MAKE_DIR)wordpress.mk -endif - # # Hosting systems # diff --git a/tools/make/kubectl.mk b/tools/make/kubectl.mk index 91237eff..c85f123f 100644 --- a/tools/make/kubectl.mk +++ b/tools/make/kubectl.mk @@ -6,6 +6,7 @@ KUBECTL_WORKDIR ?= /app PHONY += kubectl-sync-db kubectl-sync-db: ## Sync database from Kubernetes + $(call drush,sql-drop --quiet -y) ifeq ($(DUMP_SQL_EXISTS),no) $(eval POD := $(call kubectl_get_pod)) $(call step,Get database dump from $(POD)...\n) diff --git a/tools/make/wordpress.mk b/tools/make/wordpress.mk deleted file mode 100644 index b6af511c..00000000 --- a/tools/make/wordpress.mk +++ /dev/null @@ -1,98 +0,0 @@ -WP_FRESH_TARGETS := up build sync post-install -BUILD_TARGETS += set-files -WP_CONF_PATH := conf -WP_DELETE_PLUGINS := akismet hello -WP_DELETE_THEMES := twentynineteen twentyseventeen -WP_SQL_READY := yes -WP_POST_INSTALL_TARGETS := prepare -DUMP_SQL_EXISTS := $(shell test -f $(DUMP_SQL_FILENAME) && echo yes || echo no) -SYNC_TARGETS += wp-sync-db wp-sync-files - -ifeq ($(GH_DUMP_ARTIFACT),yes) - WP_FRESH_TARGETS := gh-download-dump $(WP_FRESH_TARGETS) -endif - -PHONY += fresh -fresh: ## Build fresh development environment - @$(MAKE) $(WP_FRESH_TARGETS) - -PHONY += post-install -post-install: ## Run post-install actions - @$(MAKE) $(WP_POST_INSTALL_TARGETS) - -PHONY += set-files -set-files: - $(call step,Remove obsolete files\n) - @rm -f $(WEBROOT)/*.{txt,html} $(WEBROOT)/composer.json && printf "Files deleted.\n" - $(call step,Copy $(WP_CONF_PATH)/wp-config.php to $(WEBROOT)...\n) - $(call copy,$(WP_CONF_PATH)/wp-config.php,$(WEBROOT)/wp-config.php) - -PHONY += prepare -prepare: - $(call step,Delete inactivated plugins\n) - $(call wp,plugin delete $(WP_DELETE_PLUGINS)) - $(call step,Delete inactivated themes\n) - $(call wp,theme delete $(WP_DELETE_THEMES)) - $(call step,Replace $(WP_SYNC_SOURCE) domain with local domain\n) - $(call wp,search-replace $(WP_SYNC_SOURCE_DOMAIN) $(WP_HOSTNAME)) - $(call step,Check your site: https://$(WP_HOSTNAME)) - -PHONY += wp-sync-db -wp-sync-db: ## Sync database -ifeq ($(DUMP_SQL_EXISTS),yes) - $(call step,Import local SQL dump...\n) - $(call wp,db import $(DUMP_SQL_FILENAME)) -else - $(call step,Create database dump in $(WP_SYNC_SOURCE)...) - $(eval HOST := INSTANCE_$(WP_SYNC_SOURCE)_HOST) - $(eval USER := INSTANCE_$(WP_SYNC_SOURCE)_USER) - $(eval OPTS := INSTANCE_$(WP_SYNC_SOURCE)_OPTS) - @ssh $($(OPTS)) $($(USER))@$($(HOST)) -t "cd $(DOCKER_PROJECT_ROOT)/$(WEBROOT); wp db export $(DUMP_SQL_FILENAME); exit;" - $(call step,Download $(DUMP_SQL_FILENAME) from test server...) - @scp $($(OPTS)) $($(USER))@$($(HOST)):/var/www/html/$(WEBROOT)/$(DUMP_SQL_FILENAME) ./$(DUMP_SQL_FILENAME) - $(call step,Remove the $(DUMP_SQL_FILENAME) from $(WP_SYNC_SOURCE)...) - @ssh $($(OPTS)) $($(USER))@$($(HOST)) -t "rm $(DOCKER_PROJECT_ROOT)/$(WEBROOT)/$(DUMP_SQL_FILENAME); exit;" && echo "Removed" - $(call step,Import $(DUMP_SQL_FILENAME) to local database...) - $(call wp,db import $(DUMP_SQL_FILENAME)) -endif - -PHONY += wp-sync-files -wp-sync-files: UPLOADS := wp-content/uploads -wp-sync-files: ## Sync files - $(call step,Sync files from $(WP_SYNC_SOURCE)...\n) - $(eval HOST := INSTANCE_$(WP_SYNC_SOURCE)_HOST) - $(eval USER := INSTANCE_$(WP_SYNC_SOURCE)_USER) - $(eval OPTS := INSTANCE_$(WP_SYNC_SOURCE)_OPTS) - @rsync -av -e "ssh $($(OPTS))" $($(USER))@$($(HOST)):$(DOCKER_PROJECT_ROOT)/$(WEBROOT)/$(UPLOADS)/ $(WEBROOT)/$(UPLOADS)/ - -PHONY += wp-cache-flush -wp-cache-flush: ## Flush cache - $(call step,Flush cache) - $(call wp,cache flush) - -PHONY += wp-login -wp-login: ## Get login link - $(call wp,package install aaemnnosttv/wp-cli-login-command --quiet) - $(call wp,login install --activate --yes --quiet) - $(call wp,login create 1 --url-only) - -PHONY += wp-help -wp-help: ## Show wp-cli help - $(call wp,) - -PHONY += wp-plugins -wp-plugins: ## List plugins - $(call step,List plugins) - $(call wp,plugin list) - -define wp - $(call docker_compose_exec,wp --color --path=$(DOCKER_PROJECT_ROOT)/$(WEBROOT) $(1)) -endef - -ifeq ($(WP_SYNC_SOURCE),) - $(error WP_SYNC_SOURCE is not set. Add eg. WP_SYNC_SOURCE=prod to .env file) -endif - -ifeq ($(WP_SYNC_SOURCE_DOMAIN),) - $(error WP_SYNC_SOURCE_DOMAIN is not set. Add eg. WP_SYNC_SOURCE_DOMAIN=domain.tld to .env file) -endif