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 +4 -4
- data/bin/ops +1 -1
- data/lib/environment.rb +3 -2
- data/lib/ops.rb +5 -1
- data/lib/runner.rb +3 -2
- data/ops_team.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ef9ff578bc479b6bbe53bee8143f2a0477393c32518ae15e417ab8338ac5fb4
|
4
|
+
data.tar.gz: 289a6516bda02ad14993a4529358a671a7ea500269ac9710f42a960cc5a3e524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/environment.rb
CHANGED
@@ -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"] =
|
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__
|
data/lib/runner.rb
CHANGED
@@ -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
|
data/ops_team.gemspec
CHANGED