I'm deploying a node application using PM2
and nvm
as described in the pm2 documentation. I observe the resulting folder structure, and I'm questionning myself about why it is as it is, and if there is some way to configure it.
My ecosystem.config.js
just contains the minimun information to connect to git (bitbucket) and check out the project, that's why I think it's not worth to put it here.
This is the folder structure I obtain running pm2 deploy production setup
:
source/
.git // git root
*.* // all checked out projet files
shared/
pids/ // empty folder, pids are in ~/.pm2/pids
logs/ // empty folder, logs are in ~/.pm2/logs
current/ // symlink to /source
.deploys // git commit ids
My questions are:
/current
for ? navigating directly to /source
will give the same result. In a capistrano deployment, where I have several releases checked out, having a symlink makes sense, since it allows to rollback instantly, but here I don't see how it could be useful./source
in the webroot ? Is there a way to configure this ? Maybe I'm still too much thinking in 'Apache mode', and there is no need for this ?This github issue very well describes my problem (and others) ; https://github.com/Unitech/pm2-deploy/issues/27#issue-49186558
The answer to my question is simpler that I hoped:
current/
folder misses its purpose.pm2 deploy
in a more detailed way.