Refactored the code in `src/Configuration` to include type declarations
for method arguments and returned values.
To make it easier to track what's left to do and to have a tool that
prevents "regressions" in the future, PHP_CodeSniffer and Slevomat
Coding Standard have been added.
Next, a `phpcs.xml.dist` file has been created and configured to
enforce type hints for methods. For the time being, only files in
the src/Configuration directory are now being watched.
To make it simpler to execute the checks, `lint` script has been
added to `composer.json` to allow running checks with `composer lint`.
The unit tests would fail, when started on a non-master branch.
This was happening because the test repository has been initialized
with git default branch, whereas deploy configuration expects to
work with current git branch.
This has been fixed by adding `git checkout -B BRANCH_NAME`, right after
test repo initialization to the DeployTest setup procedure, to make sure
that the test repositoryis always in sync repo-wise with the Deployer
repository.
Fixes#2181
Reworked the `deploy:check_remote` step, to use the `on(localhost(), ...)`,
instead of relying on `runLocally`.
This has been changed, to make sure that the all functions that
are being executed and are related to "local" part of the logic,
are ran on the local host.
Previously in `runLocally(sprintf("%s ls-remote $opt $repository $ref", get('bin/git')));`
the `get('bin/git')` would've been executed on the remote host, which
could have resulted in an unexpected behaviour.
By closing all of the instructions, in the closure that is executed
by the `on()` function, we are sure that the context is set to the
right host.
* Sample real-world deployment script
This is a simple Deployer script.
* Update CHANGELOG.md
* moved info about new doc page to "added" section
* After running `php bin/changelog fix`
* Clarified default_stage, made example 'staging'
Addresses issue #1866
Clarified that you need to set a default_stage in your Deployer script, and also changed the example to 'staging' since that is a better example default to have (instead of production).
* Update CHANGELOG.md
* Fixed formatting on issue number
Fix wrong change introduced in 62db938884
`.env` file should not be shared because it's release-specific. On the other hand, `.env.local` and `.env.local.php` files are specific to deployment environment and should be shared between releases.
See for details: https://github.com/deployphp/deployer/pull/1907#issuecomment-533779139
* fixed invalid phpdoc
* Update CHANGELOG.md
* fixed askChoice() @return phpdoc
it can return array on multiselect questions but also scalars on non-multi
* fixed typo
* fixed another typo
* more precise phpdoc
* Add tasks to cache a manifest of event listeners
Laravel supports automatic discovery of events and listeners since
version 5.8.9. (https://laravel.com/docs/5.8/events#event-discovery)
As the documentation states, you want to cache the manifest of event
listeners in a production environment to prevent scanning the
directories on every request.
The new tasks are not added to the deploy task because automatic event
discovery is opt-in functionality in Laravel.
* Update CHANGELOG.md
* Add check_remote_head option to avoid unnecessary new releases by checking the remote git HEAD without cloning the repo.
* Add check_remote_head into the CHANGELOG
* Add the pull request link to CHANGELOG
* Update CHANGELOG.md
Removed extra spaces: https://github.com/deployphp/deployer/pull/1759
* Fix changelog. Improve check_remote_head
* Use GrasefulSutdown exception instead of exit(0).
* Change bash if statement in check_remote_head.
* Remove redundant code.
* Replace if statement with test.