Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 72 forks source link

Allow `setup` step to be called multiple times #186

Closed pke closed 4 years ago

pke commented 4 years ago

I have the problem from CI that I don't know if pm2 deploy has already been called with setup. Calling it a second time currently results in an error when it tries to clone the repo:

Local PM2 version: 4.2.0

  ○ hook pre-setup
  ○ running setup
  ○ cloning git@deployment:pke/xstate.io.git
  ○ full fetch
fatal: destination path '/var/www/restlr.io/source' already exists and is not an empty directory.

  failed to clone

Deploy failed

Would it be possible to gracefully ignore this if the directory already exists?

Unitech commented 4 years ago

just make sure that dest is not already there