cloudspin-stack-rake 0.1.12 → 0.1.13

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
  SHA256:
3
- metadata.gz: 0aa1223902697f0b82e2093aa00c62d772d09aaa2d02ecf4cb12fe716d5a3d18
4
- data.tar.gz: '0712788a3c7948b66c5d278b4a17160b91c92c9327ad04f93250a693086000c2'
3
+ metadata.gz: 74ddadd8baaf4af1ae16f3d66b280ed337c38db420bb1ce56073cbc86309b757
4
+ data.tar.gz: 8b7ab9bc491a3db38201aefca8fa3ee1e3eb3cc2bf49c7c98fa2126e119d1ae8
5
5
  SHA512:
6
- metadata.gz: e865119cd772f2027497be65275620ba13626edfecd08ff78cdafc0c3aac74d19cce1e4cf637780643600a02afd8d623461dab576beda10edbb1ca854738420f
7
- data.tar.gz: 6a1a89829715281688092abdcfe71ee93f82bca08ab9e32c9747778b4830e61dca74e77f272d5100250ae69aea8dd4039f67796ed9bdfde356b7128f9dcaaf92
6
+ metadata.gz: a653e3900cb5263f1abce2cf23cf28c06358c6054a7fb8280503b086f411c0ea11496558fc7dc3f78630297682c7173f5e204d846fb1630d8ed22b751096bdb8
7
+ data.tar.gz: 2b7b09dcc37e4d8da48758b62e67e62052f63048bdec22cf460238a8e27597abd5b0b42a6a3c4815a00797f7f1ab28fd72f021cecc07483084410c802f29d406
@@ -6,15 +6,19 @@ module Cloudspin
6
6
  class StackTask < ::Rake::TaskLib
7
7
 
8
8
  attr_reader :instance
9
+ attr_reader :environment
10
+ attr_reader :role
9
11
  attr_reader :configuration_files
10
12
 
11
13
  def initialize(
12
14
  environment = nil,
15
+ role: 'instance',
13
16
  definition_folder: './src',
14
17
  base_folder: '.',
15
18
  configuration_files: nil
16
19
  )
17
20
  @environment = environment
21
+ @role = role
18
22
  @base_folder = base_folder
19
23
  @configuration_files = configuration_files || instance_configuration_files
20
24
 
@@ -30,10 +34,10 @@ module Cloudspin
30
34
  def instance_configuration_files
31
35
  file_list = default_configuration_files
32
36
  if @environment
33
- if File.exists? environment_config_file
37
+ if File.exists? full_path_of(environment_config_file)
34
38
  file_list << environment_config_file
35
39
  else
36
- raise "Missing configuration file for environment #{options[:environment]} (#{environment_config_file})"
40
+ raise "Missing configuration file for environment #{@environment} (#{environment_config_file})"
37
41
  end
38
42
  end
39
43
  file_list
@@ -41,13 +45,17 @@ module Cloudspin
41
45
 
42
46
  def default_configuration_files
43
47
  [
44
- "#{@base_folder}/stack-instance-defaults.yaml",
45
- "#{@base_folder}/stack-instance-local.yaml"
48
+ "#{@base_folder}/stack-#{@role}-defaults.yaml",
49
+ "#{@base_folder}/stack-#{@role}-local.yaml"
46
50
  ]
47
51
  end
48
52
 
49
53
  def environment_config_file
50
- Pathname.new("#{@base_folder}/environments/stack-instance-#{@environment}.yaml").realdirpath.to_s
54
+ "#{@base_folder}/environments/stack-#{@role}-#{@environment}.yaml"
55
+ end
56
+
57
+ def full_path_of(supplied_path)
58
+ Pathname.new(supplied_path).realdirpath.to_s
51
59
  end
52
60
 
53
61
  def define
@@ -1,7 +1,7 @@
1
1
  module Cloudspin
2
2
  module Stack
3
3
  module Rake
4
- VERSION = '0.1.12'
4
+ VERSION = '0.1.13'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudspin-stack-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kief '
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-20 00:00:00.000000000 Z
11
+ date: 2018-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cloudspin-stack