There's a web application that needs to be deployed on a remote server. There's a scp
access to this server, no working shell though, so can't just ssh
there.
The question that appeared was how to deploy the application there? Deploy, as run a prepared script that does some tasks like updating DB-schema, restarting the server, clearing caches, etc?
One thing that came to my mind was to copy all the files via scp
, then ping some URL on the destination machine (like http://production.site.com/deploy
- or any random characters there) that would fire a deployment script out there. This would require to have probably some IP-based limitations, just so not everyone entering this url fires up the deploy script (to avoid possible DOS attacks).
Another way would be to put a simple check in destination machine's cron and fire it like every 1 minute. In this case the deployment process would look like this:
- we copy whole application to production server, then copy a specific file, like
deploy.it
also - cron job checks if
deploy.it
exists anddeploy.lock
doesn't. If so, it creates a lock file (deploy.lock
) and starts a deployment script. - after a deployment script finishes running, both
deploy.it
anddeploy.lock
are deleted.
What do you think about those 2 ideas? Any more ideas about it too? I'd like to find the best (as most secure for possible screws-up and from any way od DOSing the production server) way to deploy it...