This file contains hidden or 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
| # | |
| # Cookbook Name:: deploy | |
| # Recipe:: default | |
| # | |
| # Copyright 2009, Opscode | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
This file contains hidden or 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
| # Example API For Cheffy Deploy Callbacks | |
| deploy "some app" do | |
| # boring stuff | |
| before_migrate do | |
| ruby_script "wizardry" do | |
| # wizardry here | |
| end |
This file contains hidden or 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 "eventmachine" | |
| require "fileutils" | |
| module Handler | |
| def file_modified | |
| raise "iamfail, hear me roar" | |
| puts "#{path} modified" | |
| end |
This file contains hidden or 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
| it "accepts a block for a callback (hook) attribute" do | |
| block = lambda { p :noop } | |
| lambda {@resource.send(:validate_callback_attribute, &block)}.should_not raise_error | |
| end | |
| it "accepts a proc for a callback (hook) attribute" do | |
| proc = lambda { p :noop } | |
| lambda {@resource.send(:validate_callback_attribute, proc)}.should_not raise_error | |
| end | |
This file contains hidden or 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
| $ svccfg | |
| svc:> select network/samba | |
| svc:/network/samba> listprop | |
| net-loopback dependency | |
| net-loopback/entities fmri svc:/network/loopback | |
| net-loopback/grouping astring require_any | |
| net-loopback/restart_on astring none | |
| net-loopback/type astring service | |
| net-service dependency | |
| net-service/entities fmri svc:/network/service |
This file contains hidden or 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
| # modinfo | |
| Id Loadaddr Size Info Rev Module Name | |
| 6 1180000 4623 1 1 specfs (filesystem for specfs) | |
| 8 1185df0 38c4 1 1 TS (time sharing sched class) | |
| 9 1188f50 8dc - 1 TS_DPTBL (Time sharing dispatch table) | |
| 10 1188fe0 3623e 2 1 ufs (filesystem for ufs) | |
| 11 11bc7ae 1ef - 1 fssnap_if (File System Snapshot Interface) | |
| 12 11bc8f6 1b3a 1 1 rootnex (sun4u root nexus 1.95) | |
| 13 11be023 210 57 1 options (options driver) | |
| 15 11be6ff 181a 12 1 sad (STREAMS Administrative Driver ') |
This file contains hidden or 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 "chef" | |
| require "benchmark" | |
| Chef::Config.cookbook_path = ["/tmp/slowmoin/chef-repo/cookbooks/"] | |
| Chef::CookbookLoader.new | |
| # TESTS = 10 | |
| # Benchmark.bmbm do |results| |
This file contains hidden or 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
| to cuke chef's deploy features, you need this: | |
| * htmlentities | |
| * calendar_date_select | |
| * bluecloth ~> 2.0.5 | |
| * mislav-will_paginate ~> 2.3.11 | |
| * RedCloth ~> 4.2.2 |
This file contains hidden or 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
| sudo irb | |
| irb(main):001:0> require "rubygems" | |
| => false | |
| irb(main):002:0> require "chef" | |
| => true | |
| irb(main):003:0> Chef::Mixin::Command.run_command(:command => "/etc/init.d/chef-client start") |
This file contains hidden or 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 "ipaddr" | |
| require "ip_error" | |
| module IpAddrsHelper | |
| def self.convert_port_string(port) | |
| port = port.to_s | |
| case port | |
| when /\A\d+\s*:\s*\d+\Z/ | |
| Range.new(port.split(':').first.to_i, port.split(':').last.to_i) |