Skip to content

Commit

Permalink
Merge pull request #33 from mittwald/feature/shorthand-hostname
Browse files Browse the repository at this point in the history
Add option to override hostname with "mittwald_app" shorthand
  • Loading branch information
martin-helmich authored Dec 14, 2023
2 parents 907a763 + 37adf0f commit b6ba159
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions recipes/deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Deployer;

use Deployer\Host\Host;
use Deployer\Support\ObjectProxy;
use Mittwald\Deployer\Recipes\AppRecipe;
use Mittwald\Deployer\Recipes\DomainRecipe;
use Mittwald\Deployer\Recipes\SSHUserRecipe;
Expand All @@ -25,9 +26,10 @@
* Shorthand function for defining a host with a preconfigured mittwald App.
*
* @param ?string $appId
* @return Host
* @param ?string $hostname An optional hostname to use instead of the default one
* @return Host|ObjectProxy
*/
function mittwald_app(string $appId = null): Host {
return host('mittwald')
function mittwald_app(string $appId = null, ?string $hostname = null): Host|ObjectProxy {
return host($hostname ?? 'mittwald')
->set('mittwald_app_id', $appId ?? getenv("MITTWALD_APP_ID"));
}

0 comments on commit b6ba159

Please sign in to comment.