A super simple deployment utility, it's basically an opinionated abstraction of rsync served in a capistrano fashion. Capistrano is a super cool utility, I love it, I use it all the time. But for smaller projects (websites, sinatra apps, etc), I think it's simply overkill. The great thing about bam is that you don't need to learn another DSL, it's simply just ruby that you need to edit in the deploy file to configure your deployment recipe.
gem install bam
cd into/your/project/root bamify # update the @server and @to variables in deploy.bam file # work on your project bam
How deploy.bam works
After you run
bamify, it generates a
deploy.bam file, which looks like:
# Bam Deploy File # --------------- # All you have to do is change all the variables below... # the ip or hostname of the server, can use the following conventions for this variable: # - server_name # => if you have server_name setup in ~/.ssh/config # - username@host @server = 'firstname.lastname@example.org' # the location on the server don't forget to append the slash/ @to = '~/location/to/your/web/site/or/app/' # pre_deploy_tasks : These are things that you can run locally before deployment # @pre_deploy_tasks = ['rm -rf cache/*'] # @pre_deploy_tasks =  # post_deploy_tasks : These are things that you can run locally before deployment # @post_deploy_tasks = ['rm -rf cache/*'] # @post_deploy_tasks = 
@server to your hostname or ip of your server and set
@to to the location
on the server where the your project is located, make sure that it's the parent folder (and don't forget to
append the slash '/'), so instead of
~/public_html/project_name/ you would do
Pre and Post Deployment Tasks
You can run pre and post deployment tasks by assigning or setting the @pre_deploy_tasks or @post_deploy_tasks variables. For now, you can only run tasks locally, but remember since it's just a ruby file, you can require in Net::SSH and write your own methods to run remote tasks, if it comes down to it, I might just write in that ability myself... we'll see, otherwise feel free to fork it and add it yourself :)
Ignoring Files and Directories on Deployment
What if you don't want to push certain files or directories to your host? Say you have log or tmp files that would otherwise take up space. Well if you use git, you don't have to worry simply add them to .gitignore and bam is smart enough to ignore those files on deploy as well.
- Add static revision history for integrated rollbacks
- Maybe use choice or highline to prompt to fill in values?
- Maybe add in remote tasks
Copyright (c) 2010 Vann Ek., released under the MIT license