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

What the reason of symlinked current directory? #183

Open
heleg opened this issue Sep 28, 2019 · 2 comments
Open

What the reason of symlinked current directory? #183

heleg opened this issue Sep 28, 2019 · 2 comments

Comments

@heleg
Copy link

heleg commented Sep 28, 2019

Please, help me understand: Why do we have a source directory that is always the same and then link it to current? It seems useless to me:
https://github.com/Unitech/pm2-deploy/blob/master/deploy#L256

First, we run cd for directory that was already linked, do the stuff there, then symlink it once again.
It seems like we should have different release directories or something.

What is the problem behind it? I would make a build somewhere else and then symlink it to current and then restart pm2 to have a zero-downtime restart. But I constrained to make a build on a post-deploy hook which temporarily broke my server.

@krunkosaurus
Copy link

Probably has to do with pm2 deploy revert rollback feature.

@leafac
Copy link

leafac commented Mar 21, 2020

I spent some time puzzling over this and this is the best answer I’ve found. The current symlink seems to be there for compatibility with other tools. Plus, it’s how it’s done by this other tool on which pm2-deploy seems to be based.

It doesn’t have to do with revert, which is implemented by checking out a previous commit.

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

No branches or pull requests

3 participants