vara 0.17.3 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ce2c2e730b28154e9a4dec7266f2ea1e35113e6
4
- data.tar.gz: f5304de651d5f0d8ab77168af2477d0e00b36c97
3
+ metadata.gz: 8620fbfdfd18af314cc45d3e02e44088523d3e8b
4
+ data.tar.gz: fe6a19b66417313cf0473d477a15b96d363805c1
5
5
  SHA512:
6
- metadata.gz: 67043f52e18867c3dc258d89125df22884be362d09e42d62c3c209e2ae66bcc463f2ea71ae8ad1dd7efdcd6a079ff7ce38f904b8055ee07fd675bfdc9679a908
7
- data.tar.gz: b88c30cf4ced4e267fd5b95d1c808b9609f624c8b5fce4a0ae683d75557f28c65cabd2f13f121425b7d544303d6881097ca2f80aa4ba449883bacf065f050927
6
+ metadata.gz: c723d85456760a5171762141d9ca7d9107af884c1a97cbac7344a6ae4308ff254c9e2b619bbf60fe0c8634b26fa1a05fa57d36e4c621acf1116eedf3576cba34
7
+ data.tar.gz: 46767ec90d9b672340e8ae0ba3e8bf0ec46969f41835938eb9ca1bdae9ec74289e1993cfc4029dda5433c661e229617d1f73b3587a79cdabacbd2d4c93f6a27f
data/lib/vara/cli.rb CHANGED
@@ -43,7 +43,7 @@ module Vara
43
43
  versioner = Vara::StaticVersioner.new(File.expand_path(product_dir), options.fetch('version'))
44
44
  end
45
45
  content_migrations_path = Vara::ContentMigrationsProcessor.new(File.expand_path(product_dir), versioner).process
46
- say("#{content_migrations_path} has been created")
46
+ say("#{content_migrations_path} has been created") unless content_migrations_path.nil?
47
47
  content_migrations_path
48
48
  end
49
49
 
@@ -16,6 +16,7 @@ module Vara
16
16
  # into content_migrations/migrations.yml, expanding placeholders as necessary.
17
17
  # @return [String] path to the generated content migration file
18
18
  def process
19
+ return unless File.exist?(parts_dir)
19
20
  content_migrations = load_content_migrations
20
21
  processed = versioner.update_content_migrations(content_migrations)
21
22
  save_content_migrations(processed)
@@ -26,7 +27,6 @@ module Vara
26
27
  attr_reader :product_dir, :versioner
27
28
 
28
29
  def load_content_migrations
29
- parts_dir = File.join(product_dir, 'content_migrations_parts')
30
30
  base_path = File.join(parts_dir, 'base.yml')
31
31
  content_migrations = YAML.load_file(base_path) || {}
32
32
  log.info("Composing content migrations: loaded #{base_path}")
@@ -40,6 +40,10 @@ module Vara
40
40
  content_migrations
41
41
  end
42
42
 
43
+ def parts_dir
44
+ File.join(product_dir, 'content_migrations_parts')
45
+ end
46
+
43
47
  def save_content_migrations(processed_hash)
44
48
  out_path = File.join(product_dir, 'content_migrations', 'migrations.yml')
45
49
 
@@ -7,7 +7,7 @@ module Vara
7
7
  include Loggable
8
8
 
9
9
  def initialize(artifact_path, product_contents)
10
- @artifact_path = artifact_path
10
+ @artifact_path = artifact_path
11
11
  @product_contents = product_contents
12
12
  end
13
13
 
@@ -46,8 +46,15 @@ module Vara
46
46
  copy_and_validate_compiled_packages(product_metadata)
47
47
  end
48
48
 
49
- FileUtils.mkdir('content_migrations')
50
- FileUtils.cp(product_contents.content_migrations_path, 'content_migrations')
49
+ if product_contents.content_migrations_exist?
50
+ FileUtils.mkdir('content_migrations')
51
+ FileUtils.cp(product_contents.content_migrations_path, 'content_migrations')
52
+ end
53
+
54
+ if product_contents.migrations_exist?
55
+ FileUtils.mkdir('migrations')
56
+ FileUtils.cp_r(product_contents.migrations_path, '.')
57
+ end
51
58
 
52
59
  FileUtils.mkdir('metadata')
53
60
  FileUtils.cp(product_contents.metadata_path, 'metadata')
@@ -24,6 +24,18 @@ module Vara
24
24
  paths.first
25
25
  end
26
26
 
27
+ def content_migrations_exist?
28
+ File.exist?(File.expand_path(File.join(root_path, 'content_migrations')))
29
+ end
30
+
31
+ def migrations_path
32
+ File.expand_path(File.join(root_path, 'migrations'))
33
+ end
34
+
35
+ def migrations_exist?
36
+ File.exist?(File.expand_path(File.join(root_path, 'migrations')))
37
+ end
38
+
27
39
  # @return [<String>] The paths to the release tarballs on disk
28
40
  def release_paths
29
41
  product_metadata.releases_metadata.map { |release_metadata| File.join(root_path, 'releases', release_metadata.basename) }
data/lib/vara/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Vara
2
- VERSION = '0.17.3'
2
+ VERSION = '0.18.0'
3
3
  end
4
4
 
5
5
  # Copyright (c) 2014-2015 Pivotal Software, Inc.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CF Release Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  requirements: []
207
207
  rubyforge_project:
208
- rubygems_version: 2.2.2
208
+ rubygems_version: 2.4.5
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Vara starts with a product git repository that meets specific requirements.