dasuchin / grunt-ssh-deploy

Grunt SSH Deployment
MIT License
66 stars 45 forks source link

release_subdir option #34

Closed hurricane766 closed 9 years ago

hurricane766 commented 9 years ago

I was deploying two different applications to one machine and I was using releases_to_keep which was deleting old releases. I had been deploying the two apps at the same time regularly so I wasn't having any issues until I deployed only one of the apps a number of times in one day. This resulted in releases_to_keep deleting the current release folder for the other app - oops.

So I figured that the best way to solve this was to add a release_subdir so that app release folders are completely independent. By adding release_subdir: 'myapp' to your options the release folder changes from releases/20150101120000 to releases/myapp/20150101120000.

Now when I deploy an app, to the same machine as another app that used grunt-ssh-deploy, the clean up won't affect the other app(s).

I also changed the code to use path.join rather than having to worry about slashes.

MarkRabey commented 9 years ago

+1 Great solution - I was just about to run into the same issue on an upcoming project.