Class: Bosh::Cli::Versions::MultiReleaseSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/versions/multi_release_support.rb

Instance Method Summary collapse

Constructor Details

#initialize(work_dir, default_release_name, ui) ⇒ MultiReleaseSupport


4
5
6
7
8
# File 'lib/cli/versions/multi_release_support.rb', line 4

def initialize(work_dir, default_release_name, ui)
  @work_dir = work_dir
  @default_release_name = default_release_name
  @ui = ui
end

Instance Method Details

#migrateObject


10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cli/versions/multi_release_support.rb', line 10

def migrate
  dev_releases_path = File.join(@work_dir, 'dev_releases')
  migrator = ReleasesDirMigrator.new(dev_releases_path, @default_release_name, @ui, 'DEV')
  dev_release_migrated = migrator.migrate

  final_releases_path = File.join(@work_dir, 'releases')
  migrator = ReleasesDirMigrator.new(final_releases_path, @default_release_name, @ui, 'FINAL')
  final_releases_migrated = migrator.migrate

  if final_releases_migrated || dev_release_migrated
    Bosh::Cli::SourceControl::GitIgnore.new(@work_dir).update
  end
end