Skip to content
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

Current path symlink #496

Open
luckyraul opened this issue Dec 26, 2016 · 7 comments
Open

Current path symlink #496

luckyraul opened this issue Dec 26, 2016 · 7 comments

Comments

@luckyraul
Copy link

I've started to update our deploy script from 0.3 to 1.x and have noticed that now the current symlink use a global path. In 0.3 it was a relative.

It breaks FTP clients connection through the current folder.

@luckyraul
Copy link
Author

@d4be4st ping

@stereodenis
Copy link
Contributor

@luckyraul How does ftp relate to mina?

@luckyraul
Copy link
Author

luckyraul commented Mar 10, 2017

@stereodenis

Problem is not in the FTP, it is in the new way of creating symlink for the current folder

mina 0.3 use a relative path in the symlink for the current
mina 1.0 use a absolute path in the symlink for the current

Ftp client in our case can't resolve absolute paths because of a chroot enviroment.

@x-yuri
Copy link

x-yuri commented Jun 13, 2017

In my case, it hinders obtaining Let's Encrypt certificates for LXC containers. I could run:

certbot certonly --webroot -w /var/lib/lxc/container/rootfs/home/user/app/current/public -d example.com

But current doesn't work outside of a container. In other words, absolute symlinks doesn't work outside of any chroot.

@d4be4st
Copy link
Member

d4be4st commented Oct 6, 2017

What would you do about all other linked paths?

For example the stuff that ends up in shared folder? They can have multiple parent folders and we would need to do some "calculations" for them and it links would end up like: ../../shared/public/assets to work

Or are you only interested in current folder?

@x-yuri @luckyraul

@d4be4st
Copy link
Member

d4be4st commented Oct 6, 2017

If you are only interested in current folder there is an easy solution:

set :releases_path, -> { "releases" }

Override releases path. One caveat here is that you need to wrap all tasks that use fetch(:releases) path in in_path fetch(:deploy_do) do (in default mina only deploy:cleanup and rollback

in_path fetch(:deploy_to) do
  invoke :'deploy:cleanup'
end

@x-yuri
Copy link

x-yuri commented Oct 6, 2017

I see no advantage to absolute symlinks over relative ones. I asked about it on Stack Overflow, but the best I could get is that absolute symlinks are easier to create. So I think it's best to switch to relative symlinks by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants