Last checked 25 minutes ago.
67 people have subscribed to this feed.
post frequency (last month)
PostRank™
From the { buckblogs :here } - Home, 1 month ago,
0 comments
Capistrano 2.5.0 is now available! You can read the full release announcement on the capify.org news blog.
From the { buckblogs :here } - Home, 1 month ago,
0 comments
SQLite3-Ruby version 1.2.3 is now available. It is a maintenance release, fixing just a few things:
To install or upgrade:
gem install sqlite3-ruby |
Thanks!
From the { buckblogs :here } - Home, 1 month ago,
0 comments
Are you currently using Capistrano 1.4.1? If so, drop everything (I mean it, do this RIGHT NOW) and install Capistrano 1.4.2.
Why, you ask?
Capistrano 1.4.1 will work just fine, right up until you decide you want to experiment with Capistrano 2. When you do that, Cap 2.3+ will install net-ssh 2.x, which kills Capistrano 1.4.1 in all kinds of really obscure ways.
The good news is that Cap 1.4.2 is completely compatible with Cap 1.4.1. It adds no new features. The only “bug” it fixes is that if you ever install net-ssh 2.x, Cap 1.4.2 will still happily continue to work.
Ultimately, an upgrade to Cap 2 is recommended, but I understand it’s not feasible for everyone. So, if you’re one of those who can’t go cap2 yet, please please please PLEASE PLEASE FOR THE LOVE OF ALL THAT IS HOLY upgrade to Cap 1.4.2. It’ll make your life easier, and it’ll make my life easier (because I won’t have to keep troubleshooting the same issues over and over). Thanks!
From the { buckblogs :here } - Home, 1 month ago,
0 comments
Having spent the better part of a day googling and struggling, I figured it would possibly benefit others if I took a minute to post the steps I took to clone a VMWare Fusion image. The image in question is of Ubuntu Server (Hardy). I’m using VMWare Fusion 2 (beta 2).
Just find your “Virtual Machines” folder (should be in your Documents folder), and copy the image in question to a new location. (The images are actually folders; a simple “cp -R” worked fine for me.)
Then, open the copied image in VMWare Fusion and boot it. VMWare Fusion will ask if you if you copied or moved the image—be sure to say you copied it (that let’s VMWare set up a new MAC address for your image).
Go ahead and log in once the server boots. You’ll find networking is all hosed. To fix networking, this worked for me:
Once your machine comes back up, you should have a network again! Now, if only VMWare Fusion could bake all this in somehow… :/
(Related: installing VMWare Tools on Ubuntu server. It’s from 2006, but it still worked well enough for me, though I followed the instructions for tweaking the network that the VMWare Tools install gave at the end, rather than what this gent said.)
From the { buckblogs :here } - Home, 1 month ago,
0 comments
So, the second Capistrano tutorial session has come and gone. It was a great session, though it started pretty rough. (I was very unprepared for some windows-related configuration issues during the first half-hour. That won’t happen again.) I appreciate everyone’s patience who participated!
I’m going to be quiet on the tutorial front for the next several weeks, but its not because I’ve given up on them. I’m going to be rethinking some aspects of them. I really want these to be opportunities for people to master capistrano, and while these first two tutorials have been very useful to those who attended (their words, not mine), I think they could be even better.
Stay tuned!
From the { buckblogs :here } - Home, 2 months ago,
0 comments
The first online Capistrano tutorial session was very successful, thanks to everyone who participated. Now, it’s time to try again!
The second online Capistrano tutorial session is now open for registration: http://events.capify.org/events/2.
It is scheduled for Wednesday, August 13th, at 7pm (Mountain time), and will last two hours (plus up to an hour at the end for Q&A). As before, this tutorial is targeted at beginning Capistrano users, those will little or no prior experience. (If you’re looking for a session for more advanced users, keep watching this space—I’ll probably do one of those eventually, as soon as I can write a curriculum for it.)
From the { buckblogs :here } - Home, 2 months ago,
0 comments
Tyler Bird, the director of the Capistrano documentation effort, has begun collecting links about Capistrano, to build a centralized de.licio.us account that people can use to find cap-related info around the web. You can read more about it on the capify.org/news site.
From the { buckblogs :here } - Home, 3 months ago,
0 comments
Today I’m pleased to announce the first online Capistrano tutorial session. It will be held via Campfire on July 15 at 7pm MDT, focusing on Capistrano basics for Rails deployment. The session will accomodate only ten people. For all details, read up at capify.org:
http://www.capify.org/2008/7/6/online-capistrano-tutorial-session
If this proves popular enough, and if the format works out well, I’ll consider hosting more of these on more advanced topics.
From the { buckblogs :here } - Home, 3 months ago,
0 comments
Capistrano 2.4.3 is now available!
gem install capistrano
This is a maintenance release. The changes since 2.4.0 include:
Please report bugs to the Capistrano bug tracker at Lighthouse:
Patches should be generated against the latest version of the code at GitHub:
You may submit patches via email, as submissions to the Capistrano bug tracker, or as GitHub pull-requests.
From the { buckblogs :here } - Home, 3 months ago,
0 comments
Net::SSH 2.0.3 is now available!
gem install net-ssh
This is a maintenance release that fixes the following issues:
Please report bugs to the bug tracker for net-ssh on rubyforge:
http://rubyforge.org/tracker/?atid=1123&group_id=274&func=browse
If you have a patch you want to submit, please make sure to create it against the latest version of the code in the Net::SSH repository on GitHub:
Patches may be submitted via email, as GitHub pull-requests, or as posts to the net-ssh tracker on rubyforge.
From the { buckblogs :here } - Home, 3 months ago,
0 comments
Capistrano 2.4.0 is now available.
gem install capistrano
Report bugs to Capistrano’s Lighthouse project. And if you have some ideas for patches, please patch against the code at Capistrano’s GitHub repository.
Here’s the skinny on 2.4.0:
You git users out there will be pleased to learn that this release will no longer do “git fetch --tags”, meaning your git-based deploys will finally work again. Sorry that took so long to fix. It was really ridiculously simple. :(
Mark Imbriaco added a debug switch for enabling conditional execution of commands. This is fantastic for debugging and testing tasks, since you can basically step through your tasks and approve or deny each remote command as it is executed. Just give cap the “-d” switch to enable this.
No, really. This time I mean it. I pulled the version of sudo introduced in 2.3.0 (where each sudo command was wrapped in an explicit sh invocation), and put it back almost exactly as it was. However, if you call sudo without a command to execute, it will instead return the sudo command to use. On top of that, if the run() helper detects that you’re using sudo, it will listen for password prompts. So you can now do arbitrarily complex sudo commands like this:
1 |
run "if [ -d /some/directory ]; then #{sudo} chmod -R g+w /some/directory; fi"
|
In other words, just dump the sudo() call into your command as an interpolated value, and the real sudo command gets substituted. You can pass options to it as well:
1 |
run "#{sudo :as => "bob"} something"
|
And, naturally, the original sudo() syntax we all know and love remains as before:
sudo "something", :as => "bob"
The deployment recipes themselves have been updated to use this new syntax, as needed.
Some cappers have noted that having deploy:setup and deploy:cleanup run as the :runner user messed up their carefully crafted permissions. I agreed that this was a problem. With this release, deploy:start, deploy:stop, and deploy:restart all continue to use the :runner user when sudoing, but deploy:setup and deploy:cleanup will use the :admin_runner user. The :admin_runner variable is unset, by default, meaning those tasks will sudo as root, but if you want them to run as :runner, just do “set :admin_runner, runner”.
You can now specify glob patterns with deploy:upload:
1 |
$ cap deploy:upload FILES="config/apache/*.conf" |
As before, you can also specify entire folders to upload, but now the upload is being done via the upload() helper (introduced in 2.3.0) so the behavior is more standardized.
Prior to this release, if you defined a before hook using a block, the block would be executed within the same server scope as the original task that invoked task that this hook was attached to. (whew!)
In other words:
1 2 3 4 5 6 7 8 9 10 11 12 |
task :first, :roles => :app do # ... second end task :second, :roles => :db do # ... end before :second do # ... end |
Prior to this release, when “first” calls “second”, the before hook at the bottom would get called, but it would get called with the :roles => :app server constraint active, instead of :roles => :db. This preview release makes those hooks use the server scope of the task they are attached to.
Prior to this release, when any output was processed by the :checkout, :export, or :remote_cache strategies, you’d not be able to tell what host the output was from (it’d just be prefixed [err] or [out]). With this release, that output is correctly tagged with the host that generated it, making it easier to troubleshoot issues with SCM command execution.
Some SCM’s give you the option of forcing the modification times of files that are being checked out to be the time that they were last modified in the repository. If your SCM gives you that capability, and if you enable it (however that works in your SCM), then you don’t need the massive touch command that Capistrano’s default deployment tasks run on each deploy, which is cap’s way of forcing all assets on all of your servers to have the same timestamp.
To disable Capistrano’s default timestamp normalization step, just set the :normalize_asset_timestamps variable to false:
1 |
set :normalize_asset_timestamps, false |
You could also do this if you are deploying to a single server only. Note, though, that if you do this when deploying to multiple servers, and you haven’t configured your SCM to set the timestamps on the files on checkout, then Rails may use inconsistent timestamps on the assets, causing caching of your assets to fail and resulting in longer load times for your users.
From the { buckblogs :here } - Home, 5 months ago,
0 comments
On February 16 I set myself to travel a path that I hoped would eventually help me deal with the project overload I was feeling. Today I get to release Capistrano 2.3, which is very near to the end of that path!
gem install capistrano
Capistrano 2.3 is primarily significant in that it switches to the new Net::SSH v2 library, which is faster and slimmer than the older Net::SSH v1 library. It also pulls in Net::SFTP v2, and the new Net::SSH::Gateway and Net::SCP libraries.
In addition to that, cap 2.3 adds several exciting (if I do say so myself) new features, and a few bug fixes that had lingered for far too long.
FEATURE: The :copy strategy has been significantly improved. Instead of doing a blind checkout/export, archiving the result, and copying it over, you can specify that a local cached copy of your repository should be used. If the cached copy does not exist, it is created (via a checkout), otherwise it is simply updated (a much faster operation than a checkout, typically). This functions much like the :remote_cache strategy, but locally. To use this, simply set the :copy_cache variable to true:
1 2 |
set :deploy_via, :copy set :copy_cache, true |
By default, the cached copy will be in your machine’s temporary directory (/tmp, for example), but you can specify your own location by setting :copy_cache to the desired path:
1 2 |
set :deploy_via, :copy set :copy_cache, "/u/caches/#{application}" |
But wait! There’s more! Suppose you have certain files that you don’t want to deploy, like photoshop files or your .git directory. You can set the :copy_exclude variable to a file glob (or an array of globs):
1 2 3 |
set :deploy_via, :copy set :copy_cache, true set :copy_exclude, [".git", "materials"] |
This should make your deploys faster than ever, especially using a tip I hope to share in the next day or two that uses this in conjunction with some vendor/rails symlinking.
FEATURE: Even though I strenuously believe it is a mistake to deploy anything that is not under source control, I’ve finally caved and added a dumb :none SCM module. It can be used to deploy a specific directory if used with the :copy strategy:
1 2 3 |
set :repository, "." set :scm, :none set :deploy_via, :copy |
Again, there are very, very few cases when I think use of this technique is justified, but because I ran into one myself a month ago, I decided it was worth adding.
FEATURE: Support was added for “depend :remote, file” to test for the existence of a specific file:
depend :remote, "/etc/syslog.conf" |
This is used in conjunction with the deploy:check task.
FEATURE: You can specify ssh_options per-server, now, simply by giving an :ssh_options key and corresponding hash with the server definition:
role "some.host", :ssh_options => { :keys => "/path/to/key" } |
FEATURE: There are two new file transfer helpers, upload and download, which are much more powerful and resource-friendly than the old ‘put’ and ‘get’ helpers. You can use upload and download to transfer single files, or entire directory trees:
1 2 |
upload "/local/file", "/remote/file" download "/remote/file", "/local/file" |
This will transfer to or from all active servers, which is particular tricky when using the download helper, since it will download the file simultaneously from all active hosts. To make this work, you need to make sure each is downloaded to a different location:
1 2 |
Dir.mkdir("destination") download "/remote/file", "destination/file-$CAPISTRANO:HOST$" |
The above will download the file from each host to a file on the local host, where the local file includes the name of the source host. Tricky!
Also, you can now specify that you want to upload or download via SCP instead of SFTP:
1 2 |
upload "local", "remote", :via => :scp download "remote", "local", :via => :scp |
The default is :sftp.
The less exciting (but still mildly titillating) things are the bug fixes and pleasure-enhancing behavioral changes:
So, have at it! Remember to report bugs to http://capistrano.lighthouseapp.com. And patches are always welcome via git—just fork the capistrano repository at git://github.com/jamis/capistrano.git (thanks GitHub!).
Cheers!
From the { buckblogs :here } - Home, 5 months ago,
0 comments
At last! Net::SSH 2.0 is available! Also available are Net::SFTP 2.0, Net::SCP 1.0, Net::SSH::Gateway 1.0, and Net::SSH::Multi 1.0.
1 2 3 4 5 |
$ gem install net-ssh \ net-sftp \ net-scp \ net-ssh-gateway \ net-ssh-multi |
All of these Ruby libraries are for communicating with remote servers via the SSH protocol in different ways.
Net::SSH and Net::SFTP are both significant upgrades from their previous incarnations; if you have used either library in the past, you’ll want to read the documentation (Net::SSH, Net::SFTP). The Net::SSH API is still fairly similar to the way it was before, but the Net::SFTP API is entirely different.
All have pretty complete RDoc documentation, so you should be able to employ “ri” to good effect to find your way around the libraries. (Try “ri Net::SSH”, for example, to get started.)
Per-library synopses follow.
Net::SSH 2.0
This is a significant upgrade from Net::SSH 1.x. Changes from 1.x include (but are not limited to):
1 2 3 4 5 6 |
require 'net/ssh' Net::SSH.start('localhost', 'jamis') do |ssh| ssh.exec('hostname') # prints the results to $stdout ssh.loop end |
This is a complete rewrite of the original Net::SFTP 1.x code, and shares very, very little in common with it. The new version has a much cleaner implementation and API, and provides some really handy methods for transferring files and directories.
1 2 3 4 5 6 7 8 9 10 |
require 'net/sftp' Net::SFTP.start('localhost', 'jamis') do |sftp| sftp.upload! "/local/file", "/remote/file" sftp.download! "/remote/file", "/local/file" sftp.file.open("/remote/file", "w") do |file| file.puts "here is some data" end end |
This provides a way to transfer files and directories via the SCP protocol, over Net::SSH.
1 2 3 4 5 6 |
require 'net/scp' Net::SCP.start('localhost', 'jamis') do |scp| scp.upload! "/local/file", "/remote/file" scp.download! "/remote/file", "/local/file" end |
This library makes it easy to tunnel connections though firewalls. You simply connect to the gateway machine, and then specify which ports you want forwarded.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
require 'net/ssh/gateway' gateway = Net::SSH::Gateway.new('host', 'user') gateway.ssh("host.private", "user") do |ssh| puts ssh.exec!("hostname") end gateway.open("host.private", 80) do |port| require 'net/http' Net::HTTP.get_print("127.0.0.1", "/path", port) end gateway.shutdown! |
== Net::SSH::Multi 1.0
This library makes it simple to open multiple Net::SSH connections and tie them all together, running commands in parallel (much like Capistrano does).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
require 'net/ssh/multi' Net::SSH::Multi.start do |session| # access servers via a gateway session.via 'gateway', 'gateway-user' # define the servers we want to use session.use 'user1@host1' session.use 'user2@host2' # define servers in groups for more granular access session.group :app do session.use 'user@app1' session.use 'user@app2' end # execute commands on all servers session.exec "uptime" # execute commands on a subset of servers session.with(:app).exec "hostname" # run the aggregated event loop session.loop end |
Enjoy!
From the { buckblogs :here } - Home, 5 months ago,
0 comments
With the impending releases of the improved Net::SSH family of libraries, and the next Capistrano release that will depend on them, it was time to go back and make sure that the oldies-but-goodies will still work along side these new-comers.
To that end, I present:
This maintenance release will hopefully fix the hangs that people have been reporting when dealing with long-running requests in Net::SSH, Net::SFTP, and Capistrano.
gem install net-ssh
It is strongly recommended that all Net::SSH users upgrade to this version.
This release merely adds an explicit dependency on Net::SSH and Net::SFTP versions less than 1.99.0, allowing you to use both cap1 and cap2 side-by-side after Net::SSH v2 (and friends) are released.
gem install --version 1.4.2 capistrano
If you are needing to run cap1 and cap2 side-by-side (for instance, if you haven’t yet upgraded some recipes, but want to enjoy the cap2 goodies on newer projects), you should upgrade your cap1 installation to 1.4.2. If you are completely upgraded to cap2, you can safely ignore this release.
From the { buckblogs :here } - Home, 5 months ago,
0 comments
I’m almost ready to do a preview release of the next Capistrano version, which is built on top of the new Net::SSH library. To do that, though, I need to prime the pump by pushing out a few small fixes to Net::SSH. So, behold!
gem install --source http://gems.jamisbuck.org net-ssh
This release has two minor new features and two fixed bugs:
Unrelated to Capistrano (since the next release of cap won’t be using it), I’m also pushing out a second preview release of Net::SSH::Multi, a library for managing multiple Net::SSH connections in parallel.
gem install --source http://gems.jamisbuck.org net-ssh-multi
This release has a single bug fix:
I’ll hopefully have a preview release for the next Capistrano version next week sometime. It’s close! I’m using it myself, locally, but I want to try it on a few more deploys to make sure it really works as advertised. I haven’t actually run any timings on it, but Capistrano with Net::SSH v2 feels significantly faster than it was on Net::SSH 1.x. Stay tuned!