vara 0.22.0 → 0.23.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: 53b15fc0f2bf249075d85c00adbcc4bd31a595ed
4
- data.tar.gz: 884e2d22736c9c2cb6ad17eccf9e29aff93fcf9c
3
+ metadata.gz: 9927b86468067f7e7cf07db35142614bdfcacf74
4
+ data.tar.gz: 5b13e20f8a58408252c97c5a786d4af04140d894
5
5
  SHA512:
6
- metadata.gz: a22c87efc0c7940a3e01d40ae6092c7fd6765ee6d7e9e9241708bee3beaa5b8845393926b6ba8b99c55f19b01d169cc89af65ebb23e1e7f09fbc074fd734044d
7
- data.tar.gz: d791843f683c38eefd8078797daddf201650d1832c6d3cca7412f20f4215d9d37eca63bafbe7c8c8324fd37a816262195b8342502dc12b281784d0564046a03c
6
+ metadata.gz: d954c1ebc96785c88c6fc440adc169454a5f8d4397d8ad3cfcacdba8e2f28f6798f78cbd58ac2864717cb97bd349cdc9d2e9ca418f813f7583c04700fec1a0ca
7
+ data.tar.gz: 61b7f161391c69ef1c17b404d24d746a09f052a61daa5fef5cfe5aeecfa89280292e4f5f7496934c5e13b1ee90f83bd34e17f1a042f6044d4c779071cdbf3366
@@ -84,6 +84,22 @@ module Vara
84
84
  download_artifacts(metadata_path) unless options[:exclude_releases]
85
85
  zip_pivotal(product_dir)
86
86
  end
87
+
88
+ desc 'finalize-pivotal PIVOTAL_FILE_PATH VERSION', 'Update the version of a pivotal file'
89
+ def finalize_pivotal(pivotal_file_path, version)
90
+ require 'vara/product'
91
+ Dir.mktmpdir do |temp_dir|
92
+ FileUtils.cd(temp_dir) do
93
+ `unzip #{pivotal_file_path} -d .`
94
+ output_dir = File.dirname(pivotal_file_path)
95
+ product = Vara::Product.new(temp_dir)
96
+ product.update_product_version(version)
97
+ product.build
98
+ file_path = product.path
99
+ FileUtils.cp(file_path, output_dir)
100
+ end
101
+ end
102
+ end
87
103
  end
88
104
  end
89
105
 
@@ -64,6 +64,14 @@ module Vara
64
64
  end
65
65
  end
66
66
 
67
+ def update_product_version(new_version)
68
+ metadata_hash = metadata.hash
69
+ metadata_hash['product_version'] = new_version
70
+ File.open(metadata_file, 'w') do |out|
71
+ YAML.dump(metadata_hash, out)
72
+ end
73
+ end
74
+
67
75
  private
68
76
 
69
77
  def metadata
@@ -6,6 +6,9 @@ require 'vara/metadata/compiled_packages'
6
6
  module Vara
7
7
  # "Struct" representing the information in metadata/<product_name>.yml
8
8
  class ProductMetadata
9
+
10
+ attr_reader :hash
11
+
9
12
  # Build a ProductMetadata from a metadata.yml on disk
10
13
  # @param metadata_path Path to the product metadata file on disk
11
14
  # @return [Vara::ProductMetadata]
@@ -85,8 +88,6 @@ module Vara
85
88
 
86
89
  private
87
90
 
88
- attr_reader :hash
89
-
90
91
  # @return [Vara::Metadata::Release]
91
92
  def release_metadata(release_hash)
92
93
  release = release_hash
@@ -1,5 +1,5 @@
1
1
  module Vara
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.23.0'.freeze
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.22.0
4
+ version: 0.23.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-04-25 00:00:00.000000000 Z
11
+ date: 2016-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor