Closed AjkP closed 3 years ago
Does this change make any difference at all? Maybe I am missing something but I think you will end up with the same result
And yes, being all under the same parent path is by design. In order to be able to have the current folder in a completely different location you would need an extra variable like {{ ansistrano_full_path_to_current_code }}
Does it provide any benefit at all?
Does this change make any difference at all? Maybe I am missing something but I think you will end up with the same result
They won't have the same result. With the example above:
ansistrano_deploy_to: "/var/www"
ansistrano_version_dir: "releases"
ansistrano_current_dir: "foo/bar
Actual:
Symlink /var/www/foo/bar
from /var/www/foo/releases
.
Expected:
Symlink /var/www/foo/bar
from /var/www/releases
.
After my proposed change the expected would correctly happen.
Does it provide any benefit at all?
Yes. There's many scenarios where you could want to deploy a "sub folder" of a system.
Example above. My app could start at /var/www/foo
but I want to deploy /var/www/foo/bar
separately. I don't want to keep the releases within my app (inside /var/www/foo/releases
(and have some risk that they will be accessed by third party or interfere with my development. I want to keep the releases in some separate folder under /var/www/foo_releases
or something similar, that noone has access to.
If security is your concern, you need to make sure your app cannot access those folders and your web server is properly configured. That has nothing to do with ansistrano or any deployment tool and it can happen no matter where you put the releases files if any of them are wrongly configured.
And you could always deploy to /opt/your_app and symlink /var/www/app to /opt/your_app/current in a post deployment hook if that gives you extra confidence about other releases folders not being accidentally exposed
Also, some discussion around this from years ago at https://github.com/ansistrano/deploy/issues/92 as such change can break some existing behaviors which are arguably edge cases but so is yours. And IMHO it does not justify introducing potentially breaking changes for your reasoning
I will have a look though as anyway, specifying a 2 folder structure should provide your expected result
I have worked around this, but I genuinely thought this was a bug when I first saw it (and still sort of do).
Here's another example where you'd get in a really weird place:
ansistrano_deploy_to: "/var/www"
ansistrano_version_dir: "foo/releases"
ansistrano_current_dir: "foo/bar
Now your version dir is /var/www/foo/foo/releases
It being a breaking change does kind of suck. Another option could be to just disallow nested dirs in those configs if there's other edge cases you wouldn't wanna deal with.
Closing as we will not be fixing this any time soon
This seems like a bug to me, but it might also be a feature request?
Basically what Im trying to do:
During the:
I get a failure since it's somehow assumed that they're both going to have the shared base folder.
I can make a quick pull request if someone thinks it's reasonable to change in
deploy/tasks/symlink.yml
:FROM
TO