ops_team 1.2.1 → 1.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
  SHA256:
3
- metadata.gz: 57af38c44173187c829e4f07a894dac672b86dd3033564591804b693afa87fc8
4
- data.tar.gz: bb9c475b0959e8d81d491406d533307a2276252ae99a2d27bb8bd91d1b65d302
3
+ metadata.gz: 6ef9ff578bc479b6bbe53bee8143f2a0477393c32518ae15e417ab8338ac5fb4
4
+ data.tar.gz: 289a6516bda02ad14993a4529358a671a7ea500269ac9710f42a960cc5a3e524
5
5
  SHA512:
6
- metadata.gz: d0ce89fe185230286256475fc1ada7d0fdf9d4aec5d31e0a6b2b735ea7f38d1d31a02c2dcdb65d99918cf4a47b745eb9953f60b8803b0fb739b38aabf4818984
7
- data.tar.gz: a44717efc73eac86671f942322c9ca51e83403236c7897b854a86a32876e5c2e8179b50fb1b3cdb1e47d7c12342d7e4c29c39b0f9ddc9674a9fb7325db26842b
6
+ metadata.gz: 685a469476c1ccbf25511c8ac1b0eec7cfc1eb3e9056eb8102905c88fbc48266a88dc0aaf3969ee4a6bc16bfc3cd840889d2dd3d4a39e84ce70b3eb43bb5594c
7
+ data.tar.gz: 87e5e4cb4ed35aac7107cd5614ec7fecaa66fa4fc11ffd077df87cf33daea4d324c2a7df99bac2e63507624762a67a925d132a85b6b1e08e9814ac8715cac3c8
data/bin/ops CHANGED
@@ -5,7 +5,7 @@ require 'optparse'
5
5
 
6
6
 
7
7
  def usage
8
- puts "ops [-f|--file <ops_yml>] action [<action args>"
8
+ puts "Usage: ops [-f|--file <ops_yml>] action [<action args>"
9
9
  puts " ops_yml: the config file to load instead of './ops.yml'"
10
10
  puts " action_args: arguments to the action loaded from the config file; depends on the action"
11
11
 
@@ -13,8 +13,9 @@ class Environment
13
13
  end
14
14
  end
15
15
 
16
- def initialize(env_hash)
16
+ def initialize(env_hash, config_path)
17
17
  @env_hash = env_hash
18
+ @config_path = config_path
18
19
  end
19
20
 
20
21
  def set_variables
@@ -26,7 +27,7 @@ class Environment
26
27
  private
27
28
 
28
29
  def set_ops_variables
29
- ENV["OPS_YML_DIR"] = Dir.pwd
30
+ ENV["OPS_YML_DIR"] = File.dirname(@config_path)
30
31
  ENV["OPS_VERSION"] = Version.version.to_s
31
32
  ENV["OPS_SECRETS_FILE"] = Secrets.config_path_for(Environment.environment)
32
33
  ENV["OPS_CONFIG_FILE"] = AppConfig.config_path_for(Environment.environment)
data/lib/ops.rb CHANGED
@@ -97,7 +97,7 @@ class Ops
97
97
  end
98
98
 
99
99
  def runner
100
- @runner ||= Runner.new(@action_name, @args, config)
100
+ @runner ||= Runner.new(@action_name, @args, config, config_file_absolute_path)
101
101
  end
102
102
 
103
103
  def config
@@ -121,6 +121,10 @@ class Ops
121
121
  def config_file_exists?
122
122
  File.exist?(@config_file)
123
123
  end
124
+
125
+ def config_file_absolute_path
126
+ File.expand_path(@config_file)
127
+ end
124
128
  end
125
129
 
126
130
  Ops.new(ARGV).run if $PROGRAM_NAME == __FILE__
@@ -11,10 +11,11 @@ class Runner
11
11
  class UnknownActionError < StandardError; end
12
12
  class ActionConfigError < StandardError; end
13
13
 
14
- def initialize(action_name, args, config)
14
+ def initialize(action_name, args, config, config_path)
15
15
  @action_name = action_name
16
16
  @args = args
17
17
  @config = config
18
+ @config_path = config_path
18
19
  end
19
20
 
20
21
  def run
@@ -89,6 +90,6 @@ class Runner
89
90
  end
90
91
 
91
92
  def environment
92
- @environment ||= Environment.new(env_vars)
93
+ @environment ||= Environment.new(env_vars, @config_path)
93
94
  end
94
95
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '1.2.1'
5
+ s.version = '1.2.2'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickthecook@gmail.com