capistrano: Cannot deploy without SCM
If I delete :scm, I simply cannot deploy with Capistrano 3.
For a bit of context, I use JRuby’s Warbler for deployment so I don’t actually use a SCM at all.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 1
- Comments: 34 (12 by maintainers)
An update for those interested: Capistrano 3.7 added the option to disable SCM entirely like this:
So now you can use Capistrano sans SCM, per the original request of this issue.
Furthermore, 3.7 adds a documented SCM plugin system to make building things like “git copy” more straightforward: http://capistranorb.com/documentation/advanced-features/custom-scm/
I solved this with such setup (thanks @chqr for his None SCM example!)
Added
libfolder to load path inCapfileAdded None SCM as
lib/capistrano/none.rbfile with contents:And then in
config/deploy.rbPROFIT!
As I personally think, Capistrano should be decoupled from SCMs, ad deploy not always requires
git checkoutor anything, but Capistrano provides a lot of good stuff like rollbacks, plugins, and very good flow, but sometimes all you need isrsyncsome prebuilt content to the server (and I do not want to set up build environment on server only for deploy).Thanks everyone!
I wanted to keep the core deploy task functionality, but deploy build artifacts from Travis CI. So I wrote a custom Travis “SCM” to package the build artifacts from Travis CI. It has been working well. Here’s the relevant code:
After building a release tool for rolling out Play framework release artifacts with Capistrano, I have to say: Capistrano is super easy to customize! I believe that it’s a good pattern to just define your own deployment tasks, if you deviate from the “standard capistrano” deploy process.
To start, only include:
This gives you the following deployment pipeline (have a look at http://www.capistranorb.com/documentation/getting-started/flow/ ):
Then populate those pipelined taks with your deployment functionality, e.g. something like this for release uploading (consult the examples @leehambley linked):
Remember it is rake, so you cannot just redefine tasks to overwrite them.
Actually you can overwrite rake tasks, but I consider this ugly. Have a look at this stack overflow article: http://stackoverflow.com/questions/8112074/overriding-rails-default-rake-tasks .
If you included the Capistrano standard deploy tasks you would need to override at least this two tasks:
Have a look at the Capistrano source, to see the way the scm tasks are called:
You may want to replace those tasks with tasks calling your own upload functionality.
I still think its better to populate the release pipeline with your own tasks, than overwriting existing tasks. But if you really want to do it, it is possible 😉
To play the advocate for the devil here (because I use capistrano v3 without SCM) cap does offer a lot of things that a rake/SSHKit combo lacks. Just the support for stages and the set/fetch mechanism are enough additional value to make using cap worth while.
Having said that, I don’t get the “delete :scm” line. In what context would you remove it and how is it interfering when you don’t remove it?