Class: Bosh::Gen::Command
- Includes:
- Thor::Actions
- Defined in:
- lib/bosh/gen/cli.rb
Instance Method Summary collapse
- #errand(name) ⇒ Object
- #extract_job(source_package_path) ⇒ Object
- #extract_pkg(source_package_path) ⇒ Object
- #forge(job_name) ⇒ Object
- #job(name) ⇒ Object
- #new(path) ⇒ Object
- #package(name) ⇒ Object
- #source(name, uri) ⇒ Object
- #template(job_name, file_path) ⇒ Object
Instance Method Details
#errand(name) ⇒ Object
85 86 87 88 89 |
# File 'lib/bosh/gen/cli.rb', line 85 def errand(name) dependencies = [:dependencies] || [] require 'bosh/gen/generators/errand_generator' Bosh::Gen::Generators::ErrandGenerator.start([name, dependencies]) end |
#extract_job(source_package_path) ⇒ Object
108 109 110 111 112 |
# File 'lib/bosh/gen/cli.rb', line 108 def extract_job(source_package_path) source_package_path = File.(source_package_path) require 'bosh/gen/generators/extract_job_generator' Bosh::Gen::Generators::ExtractJobGenerator.start([source_package_path]) end |
#extract_pkg(source_package_path) ⇒ Object
117 118 119 120 121 |
# File 'lib/bosh/gen/cli.rb', line 117 def extract_pkg(source_package_path) source_package_path = File.(source_package_path) require 'bosh/gen/generators/extract_package_generator' Bosh::Gen::Generators::ExtractPackageGenerator.start([source_package_path]) end |
#forge(job_name) ⇒ Object
100 101 102 103 |
# File 'lib/bosh/gen/cli.rb', line 100 def forge(job_name) require 'bosh/gen/generators/blacksmith_forge_generator' Bosh::Gen::Generators::BlacksmithForgeGenerator.start([job_name]) end |
#job(name) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/bosh/gen/cli.rb', line 75 def job(name) dependencies = [:dependencies] || [] require 'bosh/gen/generators/job_generator' job_type = [:bpm] ? 'bpm' : 'simple' Bosh::Gen::Generators::JobGenerator.start([name, dependencies, job_type]) end |
#new(path) ⇒ Object
14 15 16 17 |
# File 'lib/bosh/gen/cli.rb', line 14 def new(path) require 'bosh/gen/generators/new_release_generator' Bosh::Gen::Generators::NewReleaseGenerator.start([path]) end |
#package(name) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/bosh/gen/cli.rb', line 30 def package(name) dependencies = [:dependencies] || [] if [:apt] require 'bosh/gen/generators/package_apt_generator' Bosh::Gen::Generators::PackageAptGenerator.start([name, dependencies]) elsif [:docker_image] docker_image = [:docker_image] require 'bosh/gen/generators/package_docker_image_generator' Bosh::Gen::Generators::PackageDockerImageGenerator.start([name, docker_image]) else files = [:files] || [] sources = [:src] || [] require 'bosh/gen/generators/package_generator' Bosh::Gen::Generators::PackageGenerator.start( [name, dependencies, files, sources]) end end |
#source(name, uri) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/bosh/gen/cli.rb', line 51 def source(name, uri) flags = { :blob => [:blob] || false } dir = Dir.mktmpdir files = [] if File.exist?(uri) files = [uri] else say "Downloading #{uri}..." FileUtils.chdir(dir) do `wget '#{uri}'` files = Dir['*'].map {|f| File.(f)} end end require 'bosh/gen/generators/package_source_generator' Bosh::Gen::Generators::PackageSourceGenerator.start( [name, files, flags]) end |
#template(job_name, file_path) ⇒ Object
93 94 95 96 |
# File 'lib/bosh/gen/cli.rb', line 93 def template(job_name, file_path) require 'bosh/gen/generators/job_template_generator' Bosh::Gen::Generators::JobTemplateGenerator.start([job_name, file_path]) end |