Class: Bosh::Cli::Command::Release::CreateRelease
- Includes:
- DependencyHelper, ReleasePrintHelper
- 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, #info, #options, #out, #runner, #work_dir
Instance Method Summary collapse
Methods included from DependencyHelper
Methods inherited from Base
#add_option, #blob_manager, #blobstore, #cache_dir, #config, #confirmed?, #credentials, #deployment, #director, #initialize, #interactive?, #logged_in?, #non_interactive?, #progress_renderer, #redirect, #release, #remove_option, #run_nested_command, #show_current_state, #target, #target_name, #verbose?
Methods included from Bosh::Cli::CommandDiscovery
#desc, #method_added, #option, #register_command, #usage
Methods included from DeploymentHelper
#build_manifest, #cancel_deployment, #deployment_changed?, #inspect_deployment_changes, #job_exists_in_deployment?, #job_unique_in_deployment?, #jobs_and_indexes, #prepare_deployment_manifest, #prompt_for_errand_name, #prompt_for_job_and_index
Constructor Details
This class inherits a constructor from Bosh::Cli::Command::Base
Instance Method Details
#create(manifest_file = nil) ⇒ Object
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cli/commands/release/create_release.rb', line 22 def create(manifest_file = nil) switch_to_release_dir 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 if [:'timestamp_version'] err('Cannot specify timestamp-version 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, cache_dir, release.blobstore, [], release.dir) release_filename = manifest_file else if [:version] && [:'timestamp_version'] err('Cannot specify both timestamp-version and version when creating a release.') end version = nil if [:version] version = [:version] version = Bosh::Common::Version::ReleaseVersion.parse(version).to_s unless version.nil? end 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 |