This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snelsons@p2135447:~$ ruby --version | |
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] | |
snelsons@p2135447:~$ rvm list | |
rvm rubies | |
=> ruby-1.9.2-p290 [ i686 ] | |
ruby-1.8.7-p352 [ i686 ] | |
snelsons@p2135447:~$ rvm use 1.8.7-p352 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coromandel:tmp stephen$ mkdir example | |
coromandel:tmp stephen$ cd example/ | |
coromandel:example stephen$ git init | |
Initialized empty Git repository in /private/tmp/example/.git/ | |
coromandel:example stephen$ touch file1 | |
coromandel:example stephen$ git add . | |
coromandel:example stephen$ git commit -m 'init' | |
[master (root-commit) eba4ead] init | |
0 files changed, 0 insertions(+), 0 deletions(-) | |
create mode 100644 file1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rvm 1.8.7@basic exec gem install bundler -v='1.1.pre.8' | |
Building: | |
[workspace] $ /bin/sh -xe /ec/var/tomcat6/temp/hudson3375586474344949412.sh | |
+ /data/jenkins/jobs/statements/build.sh | |
ERROR: While executing gem ... (Errno::ENOENT) | |
No such file or directory - | |
Build step 'Execute shell' marked build as failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gems = %x[gem list --local 2>/dev/null] | |
installed_gems = {} | |
gems.each do |g| | |
gem, versions = g.split(' ',2) | |
installed_gems[gem] = versions.scan(/[\w\.]+/) | |
end | |
installed_gems.each do |gem,versions| | |
versions.each do |version| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'awesome_print' | |
gems = %x[gem list --local 2>/dev/null] | |
installed_gems = {} | |
gems.each do |g| | |
gem, versions = g.split(' ',2) | |
installed_gems[gem] = versions.scan(/[\w\.]+/) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'etc' | |
package "terminal/screen" do | |
action :install | |
end | |
screen_users = ['root'] | |
search("users", "*:*").each { |u| screen_users << u.id } | |
screenrc_paths = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tempfile' | |
def check_authorized_keys(keyfile) | |
@found_ssh = false | |
File.foreach(keyfile) do |line| | |
if line =~ /^ssh/ | |
@found_ssh = true | |
Tempfile.open('key') do |keyfile| | |
keyfile.write(line) | |
keyfile.flush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chef::Config[:solo] = false | |
class Opscode | |
class Backup | |
attr_accessor :backup_dir | |
def initialize | |
@backup_dir = Chef::Config[:knife][:chef_server_backup_dir] ? Chef::Config[:knife][:chef_server_backup_dir] : File.join(".chef", "chef_server_backup") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^I should be able to ssh to the Ubuntu server as the "([^"]*)" user$/ do |ssh_user| | |
Given 'I have the following public keys': | |
| keyfile | | |
| /root/.ssh/#{ssh_user}-test-key | | |
Then 'I can ssh to the following hosts with these credentials': | |
| hostname | username | | |
| 192.168.20.20 | #{ssh_user} | | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_cookbook(config) | |
cookbook_path = File.expand_path(File.join(File.dirname(__FILE__), | |
"../../cookbooks/cucumber-chef")) | |
version_loader = ::Chef::Cookbook::CookbookVersionLoader.new(cookbook_path) | |
version_loader.load_cookbooks | |
uploader = ::Chef::CookbookUploader.new(version_loader.cookbook_version, | |
cookbook_path) | |
uploader.upload_cookbook | |
end |