matthewtodd-captain 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ else
14
14
  require 'shoe'
15
15
  end
16
16
 
17
- Shoe.tie('captain', '0.1.0', 'Builds an Ubuntu installation CD just as you like it.') do |spec|
17
+ Shoe.tie('captain', '0.1.1', 'Builds an Ubuntu installation CD just as you like it.') do |spec|
18
18
  spec.requirements = ['mkisofs']
19
19
  spec.add_development_dependency 'cucumber'
20
20
  end
data/captain.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{captain}
5
+ s.version = "0.1.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Matthew Todd"]
9
+ s.date = %q{2009-07-30}
10
+ s.default_executable = %q{captain}
11
+ s.email = %q{matthew.todd@gmail.com}
12
+ s.executables = ["captain"]
13
+ s.extra_rdoc_files = ["README.rdoc"]
14
+ s.files = ["Rakefile", "captain.gemspec", "README.rdoc", "bin/captain", "examples/chef_client.rb", "features/installer_image.feature", "features/steps", "features/steps/captain_steps.rb", "features/support", "features/support/env.rb", "features/support/helpers.rb", "lib/captain", "lib/captain/application.rb", "lib/captain/image.rb", "lib/captain/package.rb", "lib/captain/package_list.rb", "lib/captain/release.rb", "lib/captain/remote.rb", "lib/captain/resource.rb", "lib/captain.rb", "resources/disk_base_components.erb", "resources/disk_base_installable.erb", "resources/disk_cd_type.erb", "resources/disk_info.erb", "resources/disk_udeb_include.erb", "resources/isolinux.bin", "resources/isolinux.cfg", "resources/preseed.seed.erb", "resources/release.erb", "resources/release_component.erb"]
15
+ s.rdoc_options = ["--main", "README.rdoc", "--title", "captain-0.1.1", "--inline-source"]
16
+ s.require_paths = ["lib"]
17
+ s.requirements = ["mkisofs"]
18
+ s.rubygems_version = %q{1.3.5}
19
+ s.summary = %q{Builds an Ubuntu installation CD just as you like it.}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ s.add_development_dependency(%q<matthewtodd-shoe>, [">= 0"])
27
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<matthewtodd-shoe>, [">= 0"])
30
+ s.add_dependency(%q<cucumber>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<matthewtodd-shoe>, [">= 0"])
34
+ s.add_dependency(%q<cucumber>, [">= 0"])
35
+ end
36
+ end
@@ -0,0 +1,43 @@
1
+ # This file is lifted from my first use case for Captain, bringing up a server
2
+ # with the chef gems installed, so that I can then run something like
3
+ #
4
+ # SERVER=https://my-chef-server chef-client --config /cdrom/bundle/client.rb --token ${MY_CHEF_VALIDATION_TOKEN}
5
+ #
6
+ # to get the party started. (Although, now that I think about it, maybe that
7
+ # would be more appropriately as a post-install command.) I'm eagerly awaiting
8
+ # the Ubuntu packages for chef!
9
+
10
+ # This tag will be appended to the iso filename, to help me remember.
11
+ tag 'chef-0.7.4'
12
+
13
+ repositories ['http://us.archive.ubuntu.com/ubuntu jaunty main restricted universe']
14
+ tasks ['minimal', 'standard'] #, 'server', 'openssh-server', 'mail-server', 'samba-server']
15
+
16
+ # These packages (and their dependencies) will be included in the ISO image.
17
+ include_packages [
18
+ # These guys are necessary to make it through the installation process.
19
+ 'linux-server', 'language-support-en', 'grub',
20
+ # The chef::client recipe configures chef-client to run under runit.
21
+ 'runit'
22
+ ]
23
+
24
+ # These packages will be included in the ISO image *and* installed at the end
25
+ # of the installation process.
26
+ install_packages [
27
+ # These are roughly the packages mentioned at
28
+ # http://wiki.opscode.com/pages/viewpage.action?pageId=2457665 for
29
+ # bootstrapping a chef client. I've removed the 1.8 version suffixes so
30
+ # we'll depend on the default provided packages. I've also excluded wget
31
+ # (since we install rubygems as a package, below) and ssl-cert (since we
32
+ # won't need to generate any certificates).
33
+ 'ruby', 'ruby-dev', 'libopenssl-ruby', 'rdoc', 'ri', 'irb', 'build-essential',
34
+ # Opscode suggest building rubygems from source, but I'm going to risk
35
+ # installing it as a debian package here for convenience.
36
+ 'rubygems'
37
+ ]
38
+
39
+ # Here we take advantage of the fact that captain automatically includes the
40
+ # bundle directory in the ISO image.
41
+ post_install_commands [
42
+ 'in-target gem install /cdrom/bundle/gems/chef-0.7.4.gem --local'
43
+ ]
@@ -67,13 +67,17 @@ module Captain
67
67
  end
68
68
 
69
69
  def create_iso_image
70
- Image.new(working_directory).burn(iso_image_path)
70
+ Image.new(working_directory).burn(iso_image_path, iso_image_name)
71
71
  end
72
72
 
73
73
  def installer_repository_mirror_and_codename
74
74
  repositories.first.split(' ').slice(0, 2)
75
75
  end
76
76
 
77
+ def iso_image_name
78
+ "#{label} #{version} #{tag.capitalize}"
79
+ end
80
+
77
81
  def iso_image_path
78
82
  File.join(output_directory, "#{label}-#{version}-#{tag}-#{architecture}.iso".downcase)
79
83
  end
data/lib/captain/image.rb CHANGED
@@ -6,7 +6,7 @@ module Captain
6
6
  @base_directory = base_directory
7
7
  end
8
8
 
9
- def burn(path)
9
+ def burn(path, name)
10
10
  path = Pathname.new(path)
11
11
  path.parent.mkpath unless path.parent.directory?
12
12
 
@@ -21,7 +21,7 @@ module Captain
21
21
  '-no-emul-boot',
22
22
  '-output', path,
23
23
  '-rational-rock',
24
- '-volid', 'Name',
24
+ '-volid', name,
25
25
  @base_directory) || raise('Error creating iso image.')
26
26
  end
27
27
  end
@@ -9,6 +9,7 @@ module Captain
9
9
  attr_reader :md5sum
10
10
  attr_reader :mirror
11
11
  attr_reader :name
12
+ attr_reader :tasks
12
13
 
13
14
  def initialize(mirror, codename, component, manifest)
14
15
  @mirror = mirror
@@ -31,8 +32,6 @@ module Captain
31
32
  @md5sum = $1.strip
32
33
  when /^Package:(.*)$/
33
34
  @name = $1.strip
34
- when /^Provides:(.*)$/
35
- @provides.merge(parse_list($1))
36
35
  when /^Recommends:(.*)$/
37
36
  @recommends.merge(parse_list($1))
38
37
  when /^Task:(.*)$/
@@ -51,14 +50,6 @@ module Captain
51
50
  stream.puts
52
51
  end
53
52
 
54
- def tasks
55
- @tasks
56
- end
57
-
58
- def name_and_provides
59
- @name_and_provides ||= @provides.dup.add(@name)
60
- end
61
-
62
53
  private
63
54
 
64
55
  def parse_list(string)
@@ -32,7 +32,7 @@ module Captain
32
32
  end
33
33
 
34
34
  def select_packages_by_name(pool, names=@selectors)
35
- pool.partition { |package| !package.name_and_provides.intersection(names).empty? }
35
+ pool.partition { |package| names.include?(package.name) }
36
36
  end
37
37
 
38
38
  def select_packages_by_dependencies(pool, dependent_packages)
@@ -1 +1 @@
1
- <%= label %> <%= version %> <%= tag.capitalize %>
1
+ <%= iso_image_name %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matthewtodd-captain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Todd
@@ -42,8 +42,10 @@ extra_rdoc_files:
42
42
  - README.rdoc
43
43
  files:
44
44
  - Rakefile
45
+ - captain.gemspec
45
46
  - README.rdoc
46
47
  - bin/captain
48
+ - examples/chef_client.rb
47
49
  - features/installer_image.feature
48
50
  - features/steps
49
51
  - features/steps/captain_steps.rb
@@ -77,7 +79,7 @@ rdoc_options:
77
79
  - --main
78
80
  - README.rdoc
79
81
  - --title
80
- - captain-0.1.0
82
+ - captain-0.1.1
81
83
  - --inline-source
82
84
  require_paths:
83
85
  - lib