-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from gaambo/development
v3.0.0: Rewrite to be more similar to PHP Deployers base recipes
- Loading branch information
Showing
27 changed files
with
572 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Changelog | ||
|
||
## v3.0.0 | ||
|
||
- Did a large refactor of paths (release_path, current_path, document_root) | ||
- Provide two [recipes](#recipes) (base and advanced) and examples for both | ||
- v2.0.0 did not work with symlink deployments, this now works again (see #8) | ||
- Updated from Deployer 7.2 to 7.3 | ||
- New config options (see `set.php`): | ||
- `wp/configFiles` for wp-config/wp-config-local files which should be protected by more restrict file permissions | ||
- `wp/configFiles/permissions` for the chmod permissions to apply to the configFiles | ||
- Removed `document_root` - use `release_or_current_path` instead | ||
- New/changed task names: | ||
- `push_code` now is called `update_code` again for parity with PHPDeployer. | ||
|
||
**Upgrading:** | ||
- If you haven't upgraded to v2.0.0 yet, it's best to upgrade to 3.0.0 directly | ||
- Have a look at the example files. Your deploy.php will get much smaller and require less configuration. | ||
- Also the new version is more smiliar to PHPDeployers default common recipe. | ||
|
||
## v2.0.0 | ||
|
||
- Updated from Deployer 6.x to 7.x | ||
See [docs](https://deployer.org/docs/7.x/UPGRADE#upgrade-from-6x-to-7x) for more information. | ||
Most notable changes: | ||
- New format for yml-files which can now also include configuration. | ||
- The `local` is not available any more. Instead `once` and `runLocally` should be used. For theme assets the example uses a function callback and the `on` helper to optionally run those build tasks on the local host. | ||
- When deploying you can't select a host by name or stage anymore. Instead you have to use labels (eg a `stage` label). If you've used `dep deploy production` you now have to use `dep deploy stage=production` and set the stage label in your yml file. | ||
- Switched to a single base recipe which can be included and built upon. See `examples/deploy.php`. | ||
- The new recipe and examples uses yml-files for project-specific configuration so the `deploy.php` is a dropin file and has no configuration in it. | ||
- PHP 8 compatibility. | ||
- Fixes issues with rsync flags/options and `'`. | ||
|
||
**Upgrading:** | ||
If you've used the default recipe it's probably easiest to copy the new example `deploy.php` and update your yml-file with project-specific configuration. If you have added any other tasks/features to your `deploy.php` make sure you upgrade them too. | ||
If you've used most of the core functions of this library or just the examples, the upgrade should only take a few minutes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
{ | ||
"name": "gaambo/deployer-wordpress", | ||
"description": "Deployer tasks for deploying WordPress Sites", | ||
"version": "2.0.0", | ||
"type": "library", | ||
"license": "MIT", | ||
"homepage": "https://github.com/gaambo/deployer-wordpress", | ||
"authors": [ | ||
{ | ||
"name": "Fabian Todt", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require-dev": {}, | ||
"require": { | ||
"php": "^8.0|^7.3", | ||
"deployer/deployer": "^7.2" | ||
}, | ||
"autoload": { | ||
"files": [ | ||
"autoload.php" | ||
] | ||
"name": "gaambo/deployer-wordpress", | ||
"description": "Deployer tasks for deploying WordPress Sites", | ||
"version": "3.0.0", | ||
"type": "library", | ||
"license": "MIT", | ||
"homepage": "https://github.com/gaambo/deployer-wordpress", | ||
"authors": [ | ||
{ | ||
"name": "Fabian Todt", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require-dev": {}, | ||
"require": { | ||
"php": "^8.0|^7.3", | ||
"deployer/deployer": "^7.3" | ||
}, | ||
"autoload": { | ||
"files": [ | ||
"autoload.php" | ||
] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/vendor/autoload.php'; | ||
require_once __DIR__ . '/vendor/gaambo/deployer-wordpress/recipes/advanced.php'; | ||
|
||
use function Deployer\after; | ||
use function Deployer\import; | ||
use function Deployer\localhost; | ||
use function Deployer\task; | ||
use function Gaambo\DeployerWordpress\Utils\Localhost\getLocalhost; | ||
|
||
// hosts & config | ||
import('deploy.yml'); | ||
|
||
// OPTIONAL: overwrite localhost config' | ||
localhost() | ||
->set('public_url', "{{local_url}}") | ||
->set('deploy_path', __DIR__) | ||
->set('release_path', __DIR__ . '/public') | ||
// set current_path to hardcoded release_path on local so release_or_current_path works; {{release_path}} does not work here? | ||
->set('current_path', function () { | ||
return getLocalhost()->get('release_path'); | ||
}) | ||
->set('dump_path', __DIR__ . '/data/db_dumps') | ||
->set('backup_path', __DIR__ . '/data/backups'); | ||
|
||
/** | ||
* Example Deployment Configuration: | ||
*/ | ||
// only push WordPress core files, themes, mu-plugins, plugins (not uploads, ) | ||
// task('deploy:update_code', ['wp:push', 'plugins:push', 'mu-plugins:push', 'themes:push']) | ||
// ->desc("Pushes updated code to target host"); | ||
|
||
// // install theme composer vendors composer on server | ||
// after('deploy:update_code', 'theme:vendors'); | ||
|
||
// // install mu-plugin vendors after deploying (on remote host) | ||
// after('deploy:update_code', 'mu-plugin:vendors'); |
Oops, something went wrong.