Open kimown opened 5 years ago
Alternative workaround:
pre-deploy
: delete pm2 app, delete current
folder
// ecosystem.config.js
module.exports = {
"deploy": {
"production": {
"user": "xxxxxx",
"host": ["xxxxxx"],
"ref": "xxxxxx",
"repo": "xxxxx",
"path": "C:/test",
"pre-deploy": "pm2 delete ecosystem.config.js && rm -rf C:/test/current",
"post-deploy": "npm install && pm2 startOrRestart ecosystem.config.js"
}
}
}
OS: windows server 2016 SHELL: git-bash
In windows using git-bash , when run
ln -sfn source current
, will throw error:https://github.com/Unitech/pm2-deploy/blob/master/deploy#L225
UPDATED: I add
run "rm -rf $path/current"
before line 225 to solve this problem