Finally finished tuning up the code for my kirby project, bought a license, now just need some help with deployment. I’m a real beginner! So if you have any references/advice please keep this in mind haha. Up until now I’ve been manually transferring files via FTP.
I’ve been trying to find the best way to get my site live and there are so many options, I’m not sure which are relevant to me. I’ve got shared hosting on Zuver where I already have a php-based site (which I need to delete).
I have key-based SSH access
Using vagrant to develop locally on an Ubuntu 14.04 box (as per Travis Maynard’s example)
I want to continuously(?) push from my local repo to zuver (I fiddle with css a lot)
Using git for version control locally
Not sure which of these I should be doing?
Vagrant push (doesn’t look like its for continuous deployment—would upload everything each time or have to manually specify which files were changed?)
Let’s start by making clear that all of what I’m about to write is pure opinion - my opinion. “Best practice” is a matter of who defines “best” and how
From your description I’m assuming you’re the sole developer of this project, which heavily influences my recommendation.
Rsync is probably the easiest / most reasonable to set up and use as a single developer - assuming that your shared hosting supports it (I’ve seen shared hostings that did not). You can essentially deploy with a single rsync command and it is fairly easy to turn this into a gulp task (if you happen to be using gulp anyway) or similar. I’ve used rsync-based deployments - some with bash scripts, some with gulp - many times and so far I can’t complain. Given your limited experience, I would recommend this approach to start with.
Git push is IMO the most reliable way to get an exact commit deployed. It does however require a bit of manual work to get set up - I’m assuming you would want to automate the deployment being triggered by a push to your origin/master branch. See https://gist.github.com/thomasfr/9691385
Vagrant push may seem a bit inelegant since (S)FTP always copies all the files, but it does have its advantages as it is extremely easy to set up and works reliably even on hosting environments that don’t provide a useful shell environment (or none at all).
Capistrano is awesome for deployment because it is very powerful and can do almost anything. It does however come with a steep learning curve and its real advantages IMO only come into play if you have multiple projects and/or multiple developers and/or advanced deployment scenarios with multiple environemtns, load balancing, clusters etc.The question is, whether or not you have the time to really get to know Capistrano (it’s definitely worth a look).
Other deploy / build tools - there are so many and as a single developer, setting up a dedicated build / deployment system seems hardly worth the effort unless you have more than just a few projects that you would like to deploy consistently.
All of the above - only if building highly complex deployment scenarios is your hobby (and I’m not judging ;)), or if you’re payed to do that.
I’m sure the next post will contain different opinions. In the end you’ll have to make your own decision anyway
I think there are already some posts lurking around in this forum about this topic, maybe you find some fitting answer there too.
Never the less I could suggest you to try out https://www.deployhq.com/ . It has 1 repository in their free plan with 10 deploys per day. You can set a branch from which deployhq should deploy changes (e.g. your master branch). It is up to you if to chose from different upload methods like: sftp / ftp or ssh.