Skip to content

Info: Add application name to possible 'what' info #4075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/recipe/deploy/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ require 'recipe/deploy/info.php';

## Configuration
### what
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L8)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L9)

Defines "what" text for the 'deploy:info' task.
Uses one of the following sources:
1. Repository name
2. Application name
:::info Autogenerated
The value of this configuration is autogenerated on access.
:::
Expand All @@ -26,7 +27,7 @@ The value of this configuration is autogenerated on access.


### where
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L20)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L25)

Defines "where" text for the 'deploy:info' task.
Uses one of the following sources:
Expand All @@ -43,7 +44,7 @@ The value of this configuration is autogenerated on access.
## Tasks

### deploy\:info {#deploy-info}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L29)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/info.php#L34)

Displays info about deployment.

Expand Down
5 changes: 5 additions & 0 deletions recipe/deploy/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
// Defines "what" text for the 'deploy:info' task.
// Uses one of the following sources:
// 1. Repository name
// 2. Application name
set('what', function () {
$repo = get('repository');
if (!empty($repo)) {
return preg_replace('/\.git$/', '', basename($repo));
}
$application = get('application');
if (!empty($application)) {
return $application;
}
return 'something';
});

Expand Down