-
Notifications
You must be signed in to change notification settings - Fork 0
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 studio24/add-check-deployer
Add check for local deployer
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Check local deployer recipe | ||
|
||
Checks that deployment is running via the local Deployer install. | ||
## Usage | ||
|
||
Either [install all Studio 24 tasks](../README.md#installation) or install this individual task by adding to your `deploy.php`: | ||
|
||
```php | ||
require 'vendor/studio24/deployer-recipes/src/check-local-deployer.php'; | ||
``` | ||
|
||
## Configuration | ||
The recipe detects the first item in the array of file paths only | ||
```` | ||
$scriptPath = get_included_files()[0]; | ||
```` | ||
|
||
## Tasks | ||
|
||
- `s24:check-local-deployer` – checks whether you are running local deployer, if not it stops the deployment | ||
|
||
## Usage | ||
|
||
Add task to the start of your `deploy.php` script: | ||
|
||
``` | ||
task('deploy', [ | ||
... | ||
// Add before deploy:info | ||
's24:check-local-deployer', | ||
// Run initial checks | ||
'deploy:info', | ||
... | ||
]); | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Deployer; | ||
|
||
desc('Check currently used deployer path'); | ||
task('s24:check-local-deployer', function () { | ||
|
||
$scriptPath = get_included_files()[0]; | ||
|
||
if (strpos($scriptPath, __DIR__.'/vendor/deployer/deployer/bin/dep') !== true) { | ||
throw new \RuntimeException("Pleaae run using local Deployer with ./vendor/bin/dep"); | ||
} | ||
}); |