Class: Bosh::Cli::Command::Release::CreateRelease
- Includes:
- DependencyHelper
- Defined in:
- lib/cli/commands/release/create_release.rb
Constant Summary collapse
- DEFAULT_RELEASE_NAME =
'bosh-release'
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
#args, #exit_code, #options, #out, #runner, #work_dir
Instance Method Summary collapse
Methods included from DependencyHelper
Methods inherited from Base
#add_option, #blob_manager, #blobstore, #config, #confirmed?, #deployment, #director, #initialize, #interactive?, #logged_in?, #non_interactive?, #password, #redirect, #release, #remove_option, #target, #target_name, #username, #verbose?
Methods included from Bosh::Cli::CommandDiscovery
#desc, #method_added, #option, #register_command, #usage
Methods included from DeploymentHelper
#cancel_deployment, #deployment_changed?, #inspect_deployment_changes, #job_exists_in_deployment?, #job_must_exist_in_deployment, #job_unique_in_deployment?, #jobs_and_indexes, #latest_release_versions, #prepare_deployment_manifest, #prompt_for_job_and_index, #resolve_release_aliases, #warn_about_stemcell_changes
Constructor Details
This class inherits a constructor from Bosh::Cli::Command::Base
Instance Method Details
#create(manifest_file = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cli/commands/release/create_release.rb', line 18 def create(manifest_file = nil) check_if_release_dir migrate_to_support_multiple_releases if manifest_file && File.file?(manifest_file) if [:version] err('Cannot specify a custom version number when creating from a manifest. The manifest already specifies a version.'.make_red) end say('Recreating release from the manifest') Bosh::Cli::ReleaseCompiler.compile(manifest_file, release.blobstore) release_filename = manifest_file else version = [:version] version = Bosh::Common::Version::ReleaseVersion.parse(version).to_s unless version.nil? release_filename = create_from_spec(version) end if release_filename release.latest_release_filename = release_filename release.save_config end rescue SemiSemantic::ParseError err("Invalid version: `#{version}'. Please specify a valid version (ex: 1.0.0 or 1.0-beta.2+dev.10).".make_red) rescue Bosh::Cli::ReleaseVersionError => e err(e..make_red) end |