rake-stretcher 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30cccf2835da9e4e3821bc00b60bf25fc4641042
4
- data.tar.gz: 01aa801edd1922b3326525c094d39daf7c2d7abe
3
+ metadata.gz: edd76c646b947595620f2df2a3e8c6d0af6d4bb0
4
+ data.tar.gz: 896025ff0d24140e493bb1813226e6cf7b7fa035
5
5
  SHA512:
6
- metadata.gz: a1e75ea98bbdaefa720ecdc34f4bb32fc5727c2e4bd29e3b4a120c1d9b7f032e04362c264d7814ae15c037c38d9e7b588ab7a6b039d945c4ff9034cbd803d6c1
7
- data.tar.gz: 7fd4f91bc3983c6960156f06a3b97beb30f8c4feb07550215466d0789956d0da26db767238b29ed10b0d45db71f2211c374131af6e6227db834d972e7c272952
6
+ metadata.gz: 7ca2cdbb1929088372db9334135825bd7b497c01fde062361c7410948e6be8fce0322f250165144f37fbe09ce370958de3ecfb794309d591b9d6481836f502a6
7
+ data.tar.gz: d981187da5731232a3c825c3be1fc629ba0d2fd12d22d3cdbc95ee39c0504d03ed0eca3376bb707c1c4c697b8a17f6a768de673e2dc196402bbb9e9f26fdb503
@@ -6,7 +6,7 @@ require 'open3'
6
6
  namespace :stretcher do
7
7
 
8
8
  def config
9
- config ||= YAML.load_file(File.expand_path('config/stretcher.yml'))
9
+ config ||= YAML.load(ERB.new(IO.read('config/stretcher.yml')).result)
10
10
  end
11
11
 
12
12
  def local_working_path_base
@@ -38,7 +38,7 @@ namespace :stretcher do
38
38
  end
39
39
 
40
40
  def branch
41
- config['branch'] ||= 'master'
41
+ ENV['BRANCH'] || config['branch'] ||= 'master'
42
42
  end
43
43
 
44
44
  def current_version
@@ -57,14 +57,6 @@ namespace :stretcher do
57
57
  config['tarball_name']
58
58
  end
59
59
 
60
- def stretcher_path
61
- config['stretcher_path']
62
- end
63
-
64
- def stretcher_src
65
- "#{stretcher_path}/#{tarball_name}-#{environment}.tgz"
66
- end
67
-
68
60
  def checksum
69
61
  %x(openssl sha256 #{local_tarball_path}/current/#{tarball_name} | awk -F' ' '{print $2}').chomp
70
62
  end
@@ -89,6 +81,10 @@ namespace :stretcher do
89
81
  config['stretcher_hook']
90
82
  end
91
83
 
84
+ def stretcher_src
85
+ config['stretcher_src']
86
+ end
87
+
92
88
  def consul_host
93
89
  config['consul_host']
94
90
  end
@@ -149,7 +145,7 @@ namespace :stretcher do
149
145
  desc "create and upload manifest"
150
146
  task :create_and_upload_manifest do
151
147
  template = File.read(File.expand_path('../../templates/manifest.yml.erb', __FILE__))
152
- yaml = YAML.load(ERB.new(%x(cat #{local_build_path}/config/#{stretcher_hook})).result(binding))
148
+ yaml = YAML.load(ERB.new(IO.read("#{local_build_path}/config/#{stretcher_hook}")).result(binding))
153
149
  deploy_roles.each do |role|
154
150
  hooks = yaml[role]
155
151
  yml = ERB.new(template).result(binding)
@@ -1,5 +1,5 @@
1
1
  module Rake
2
2
  module Stretcher
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-stretcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tjinjin