terminal42 / deployer-recipes

Tools and recipes for deployer.org
MIT License
10 stars 3 forks source link

Alternative hostname when resetting opcache #13

Closed m-vo closed 4 years ago

m-vo commented 4 years ago

The task deploy:opcache_reset currently uses the configured hostname to determine the url: https://github.com/terminal42/deployer-recipes/blob/1bcd95fa71ed0e9eb012a66b8805a74c27ac1bb1/recipe/deploy.php#L126-L134

For me most of the time the hostname is the alias of the configured ssh identity and never of the actual publicly reachable domain. What about querying another config key (sth. like public_hostname or domain) and falling back to the hostname? :slightly_smiling_face:

richardhj commented 4 years ago

That's my task!

So, I'm aware of the issue but recently I always used the domain name as the hostname. IMO you can introduce a new config key (same as I did in 5f63db0daaf0c4bba49b213e0cf64b50f280f3d5).

Code has to be something like this:

    try {
        if (!$domain = get('domain')) {
           $domain = get('hostmame'));
        }
    } catch (ConfigurationException $e) {}

PR welcome after verified that this is working properly :)

m-vo commented 4 years ago

I'm closing this in favor of #14