{"id":18207571,"url":"https://github.com/sourcebroker/deployer-extended-wordpress-composer","last_synced_at":"2025-04-02T16:31:11.209Z","repository":{"id":44404611,"uuid":"167999689","full_name":"sourcebroker/deployer-extended-wordpress-composer","owner":"sourcebroker","description":"Composer based WordPress deployment with deployer.org.","archived":false,"fork":false,"pushed_at":"2023-02-07T22:03:54.000Z","size":52,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T03:04:55.768Z","etag":null,"topics":["bedrock","deploy","deployer","deployment","sb-dewc","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcebroker.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-28T16:58:31.000Z","updated_at":"2025-01-12T17:22:59.000Z","dependencies_parsed_at":"2023-01-27T05:15:40.551Z","dependency_job_id":null,"html_url":"https://github.com/sourcebroker/deployer-extended-wordpress-composer","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdeployer-extended-wordpress-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdeployer-extended-wordpress-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdeployer-extended-wordpress-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdeployer-extended-wordpress-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcebroker","download_url":"https://codeload.github.com/sourcebroker/deployer-extended-wordpress-composer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246850872,"owners_count":20844158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bedrock","deploy","deployer","deployment","sb-dewc","wordpress"],"created_at":"2024-11-03T13:03:32.071Z","updated_at":"2025-04-02T16:31:10.947Z","avatar_url":"https://github.com/sourcebroker.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"deployer-extended-wordpress-composer\n====================================\n\n.. contents:: :local:\n\nWhat does it do?\n----------------\n\nThis package provides deploy task for deploying WordPress with deployer (deployer.org) and additionally a tasks\nto synchronize database and media files.\n\nThe deployment is expected to be compatible with capistrano based for https://roots.io/bedrock/\n\nDependencies\n------------\n\nThis package depends on following packages:\n\n- | `sourcebroker/deployer-extended`_\n  | Package which provides some deployer tasks that can be used for any framework or CMS.\n\n- | `sourcebroker/deployer-extended-database`_\n  | Package which provides some php framework independent deployer tasks to synchronize database.\n\n- | `sourcebroker/deployer-extended-media`_\n  | Package which provides some php framework independent deployer tasks to synchronize media.\n\n- | `wp-cli/search-replace-command`_\n  | Package to change domains after database synchronization. Part of wp-cli/wp-cli utility.\n\n\nInstallation\n------------\n\n1) Install package with composer:\n   ::\n\n      composer require sourcebroker/deployer-extended-wordpress-composer\n\n2) If you are using deployer as phar then put following lines in your deploy.php:\n   ::\n\n      require __DIR__ . '/vendor/autoload.php';\n      new \\SourceBroker\\DeployerExtendedWordpressComposer\\Loader();\n\n3) Remove task \"deploy\" from your deploy.php. Otherwise you will overwrite deploy task defined in\n   deployer/deploy/task/deploy.php\n\n4) Example deploy.php file:\n   ::\n\n    \u003c?php\n\n    namespace Deployer;\n\n    require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php');\n    new \\SourceBroker\\DeployerExtendedWordpressComposer\\Loader();\n\n    set('repository', 'git@my-git:my-project.git');\n\n    host('live')\n        -\u003esetHostname('111.111.111.111')-\u003eport(22)\n        -\u003esetRemoteUser('www-data')\n        -\u003eset('branch', 'master')\n        -\u003eset('public_urls', ['https://www.example.com/'])\n        -\u003eset('deploy_path', '/var/www/example.com.live');\n\n    host('beta')\n        -\u003esetHostname('111.111.111.111')-\u003eport(22)\n        -\u003esetRemoteUser('www-data')\n        -\u003eset('branch', 'beta')\n        -\u003eset('public_urls', ['https://beta.example.com/'])\n        -\u003eset('deploy_path', '/var/www/example.com.beta');\n\n    host('dev')\n        -\u003eset('public_urls', ['https://example-com.local/'])\n        -\u003eset('deploy_path', getcwd());\n\n\nMind the declaration of host('dev'); Its needed for database tasks to declare domain replacements,\nand path to store database dumps.\n\n\nSynchronizing database\n----------------------\n\nDatabase synchronization is done with `sourcebroker/deployer-extended-database`.\nExample of command for synchronizing database from live to local instance:\n::\n\n   dep db:pull live\n\nYou can also copy database from live to beta instance like:\n::\n\n   dep db:copy live --options=target:beta\n\n\n\nDomain replacement\n++++++++++++++++++\n\nThe \"post_command\" task \"db:import:post_command:wp_domains\" will change domains declared in \"public_urls\". Domain\nreplacement is done with cli command \"search-replace\" from `wp-cli/wp-cli`_.\n\nPlease mind to have the same amount of \"public_urls\" for each of instances because replacement on domains is done for\nevery pair of corresponding urls.\n\nLook at following example to give you idea:\n::\n\n    host('live')\n        -\u003esetHostname('111.111.111.111')\n        -\u003esetRemoteUser('www-data')\n        -\u003eset('public_urls', ['https://www.example.com', 'https://sub.example.com'])\n        -\u003eset('deploy_path', '/var/www/example.com.live');\n\n    host('beta')\n        -\u003esetHostname('111.111.111.111')\n        -\u003esetRemoteUser('www-data')\n        -\u003eset('public_urls', ['https://beta.example.com', 'https://beta-sub.example.com'])\n        -\u003eset('deploy_path', '/var/www/example.com.beta');\n\n    host('dev')\n        -\u003eset('public_urls', ['https://example-com.dev', 'https://sub-example-com.dev'])\n        -\u003eset('deploy_path', getcwd());\n\n\nThe if you will do:\n::\n\n    dep db:pull live\n\nthe following commands will be done automatically after database import:\n::\n\n    wp search-replace https://www.example.com https://example-com.dev\n    wp search-replace https://sub.example.com https://sub-example-com.dev\n\n\nShould I use \"deployer-extended-wordpress\" or \"deployer-extended-wordpress-composer\"?\n-------------------------------------------------------------------------------------\n\nIn `sourcebroker/deployer-extended-wordpress`_ the WordPress and third party plugins are installed manually. What you have in git is\nbasically only your theme. The good thing is that in such case you can update WordPress and plugins automatically.\nThis can be considered as preferable for low budget WordPress websites.\n\nIn `sourcebroker/deployer-extended-wordpress-composer`_ the WordPress and third party plugins are installed using composer.\nThis way you gain more control over what is installed but at the same time to install new WordPress or new plugin\nversion you need first to modify composer.json or do composer update (depending how big upgrade you do). Then you need\nto commit composer.json / composer.lock and do deploy which will install new version of WordPress and plugins.\nThis is additional work that can not be easily automated. One of additional advantages of this solution is that you can\neasily cleanup infected WordPress/plugins files as with each deployment all php files are fresh (part from your git\nand part from composer repositories).\n\n\n.. _sourcebroker/deployer-extended: https://github.com/sourcebroker/deployer-extended\n.. _sourcebroker/deployer-extended-media: https://github.com/sourcebroker/deployer-extended-media\n.. _sourcebroker/deployer-extended-database: https://github.com/sourcebroker/deployer-extended-database\n.. _sourcebroker/deployer-extended-wordpress: https://github.com/sourcebroker/deployer-extended-wordpress\n.. _sourcebroker/deployer-extended-wordpress-composer: https://github.com/sourcebroker/deployer-extended-wordpress-composer\n.. _wp-cli/search-replace-command: https://github.com/wp-cli/search-replace-command\n.. _wp-cli/wp-cli: https://github.com/wp-cli/wp-cli\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fdeployer-extended-wordpress-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcebroker%2Fdeployer-extended-wordpress-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fdeployer-extended-wordpress-composer/lists"}