Class: Bosh::Gen::Generators::PackageAptGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/bosh/gen/generators/package_apt_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #check_name ⇒ Object
- #check_root_is_release ⇒ Object
- #packaging ⇒ Object
- #show_instructions ⇒ Object
- #warn_missing_dependencies ⇒ Object
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 12 def self.source_root File.join(File.dirname(__FILE__), "package_apt_generator", "templates") end |
Instance Method Details
#check_name ⇒ Object
22 23 24 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 22 def check_name raise Thor::Error.new("'#{name}' is not a valid BOSH id") unless name.bosh_valid_id? end |
#check_root_is_release ⇒ Object
16 17 18 19 20 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 16 def check_root_is_release unless File.exist?("jobs") && File.exist?("packages") raise Thor::Error.new("run inside a BOSH release project") end end |
#packaging ⇒ Object
35 36 37 38 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 35 def packaging directory 'packages' directory 'jobs' end |
#show_instructions ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 40 def show_instructions say "Next steps:", :green say <<-README.gsub(/^ /, '') 1. Edit packages/#{name}/packaging to specify list of debian packages to install 2. Add "#{name}-pkg-install" job into deployment manifest README end |
#warn_missing_dependencies ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/bosh/gen/generators/package_apt_generator.rb', line 26 def warn_missing_dependencies dependencies.each do |d| raise Thor::Error.new("dependency '#{d}' is not a valid BOSH id") unless d.bosh_valid_id? unless File.exist?(File.join("packages", d)) say_status "warning", "missing dependency '#{d}'", :yellow end end end |