ops_team 1.20.2.pre.rc1 → 1.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependencies/sshkey.rb +1 -5
- data/lib/ops.rb +3 -1
- data/ops_team.gemspec +3 -3
- metadata +9 -11
- data/bin/ops.orig +0 -42
- data/lib/dependencies/helpers/ssh_key_decryptor.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6544a5e51d57b3cc01a3c8e0b1b8fab0adf6734be81dcad66154ca344e129e15
|
4
|
+
data.tar.gz: 855d1adc6a202256a761c4d09149444bb0bd775da479292c9f18dd32065a479c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12060be2f05b3eb3c346918a757be80cb220eef373871fc6c256a6ff262f7f1df8ca8d7915c120cdb141bbde507f30c93dd7d9c9b2b8d08c882b509e3cc5bea7
|
7
|
+
data.tar.gz: 5c8e7d7077493e8482a5691ec7b3894a23ec039a913ba01b808276017ec39f8d52726bb7bcd0e62f7d1f69d55d21e2f9d24dbc925908edd5ef80efa7a65250c6
|
data/lib/dependencies/sshkey.rb
CHANGED
@@ -54,11 +54,7 @@ module Dependencies
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def unencrypted_key
|
57
|
-
Net::SSH::KeyFactory.
|
58
|
-
end
|
59
|
-
|
60
|
-
def decryptor
|
61
|
-
@decryptor ||= Helpers::SshKeyDecryptor.new(priv_key_name, passphrase)
|
57
|
+
Net::SSH::KeyFactory.load_private_key(priv_key_name, passphrase.empty? ? nil : passphrase)
|
62
58
|
end
|
63
59
|
|
64
60
|
def key_comment
|
data/lib/ops.rb
CHANGED
@@ -9,6 +9,8 @@ end
|
|
9
9
|
Profiler.measure("ops:requires_internal") do
|
10
10
|
end
|
11
11
|
|
12
|
+
CONFIG_FILES = ["ops.yaml", "ops.yml"].freeze
|
13
|
+
|
12
14
|
# executes commands based on local `ops.yml`
|
13
15
|
class Ops
|
14
16
|
INVALID_SYNTAX_EXIT_CODE = 64
|
@@ -30,7 +32,7 @@ class Ops
|
|
30
32
|
def initialize(argv, config_file: nil)
|
31
33
|
@action_name = argv[0]
|
32
34
|
@args = argv[1..-1]
|
33
|
-
@config_file = config_file || "ops.yml"
|
35
|
+
@config_file = config_file || CONFIG_FILES.find { |file| File.exist?(file) } || "ops.yml"
|
34
36
|
|
35
37
|
Options.set(config["options"] || {})
|
36
38
|
end
|
data/ops_team.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'ops_team'
|
5
|
-
s.version = '1.
|
5
|
+
s.version = '1.21.1'
|
6
6
|
s.authors = [
|
7
7
|
'nickthecook@gmail.com'
|
8
8
|
]
|
@@ -23,13 +23,13 @@ Gem::Specification.new do |s|
|
|
23
23
|
'ops_team.gemspec'
|
24
24
|
]
|
25
25
|
s.executables << 'ops'
|
26
|
-
s.required_ruby_version = '> 2.
|
26
|
+
s.required_ruby_version = '> 2.6'
|
27
27
|
s.add_runtime_dependency 'bcrypt_pbkdf', '~> 1.0', '>= 1.0.1'
|
28
28
|
s.add_runtime_dependency 'colorize', '~> 0.8', '>= 0.8.1'
|
29
29
|
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1', '>= 1.1.7'
|
30
30
|
s.add_runtime_dependency 'ed25519', '~> 1.2', '>= 1.2.4'
|
31
31
|
s.add_runtime_dependency 'ejson', '~> 1.2', '>= 1.2.1'
|
32
|
-
s.add_runtime_dependency 'net-ssh', '~>
|
32
|
+
s.add_runtime_dependency 'net-ssh', '~> 7.1', '>= 7.1.0'
|
33
33
|
s.add_runtime_dependency 'require_all', '~> 1.1', '>= 1.1.6'
|
34
34
|
s.add_runtime_dependency 'zeitwerk', '~> 2.5', '>= 2.5.3'
|
35
35
|
s.license = 'GPL-3.0-only'
|
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.
|
4
|
+
version: 1.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nickthecook@gmail.com
|
@@ -116,20 +116,20 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - "~>"
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
119
|
+
version: '7.1'
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
122
|
+
version: 7.1.0
|
123
123
|
type: :runtime
|
124
124
|
prerelease: false
|
125
125
|
version_requirements: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
129
|
+
version: '7.1'
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
132
|
+
version: 7.1.0
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: require_all
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -180,7 +180,6 @@ files:
|
|
180
180
|
- Gemfile
|
181
181
|
- bin/benchmark
|
182
182
|
- bin/ops
|
183
|
-
- bin/ops.orig
|
184
183
|
- bin/print_config
|
185
184
|
- bin/print_secrets
|
186
185
|
- bin/tag
|
@@ -215,7 +214,6 @@ files:
|
|
215
214
|
- lib/dependencies/docker.rb
|
216
215
|
- lib/dependencies/gem.rb
|
217
216
|
- lib/dependencies/helpers/apt_cache_policy.rb
|
218
|
-
- lib/dependencies/helpers/ssh_key_decryptor.rb
|
219
217
|
- lib/dependencies/pip.rb
|
220
218
|
- lib/dependencies/snap.rb
|
221
219
|
- lib/dependencies/sshkey.rb
|
@@ -247,14 +245,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
247
245
|
requirements:
|
248
246
|
- - ">"
|
249
247
|
- !ruby/object:Gem::Version
|
250
|
-
version: '2.
|
248
|
+
version: '2.6'
|
251
249
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
250
|
requirements:
|
253
|
-
- - "
|
251
|
+
- - ">="
|
254
252
|
- !ruby/object:Gem::Version
|
255
|
-
version:
|
253
|
+
version: '0'
|
256
254
|
requirements: []
|
257
|
-
rubygems_version: 3.
|
255
|
+
rubygems_version: 3.1.6
|
258
256
|
signing_key:
|
259
257
|
specification_version: 4
|
260
258
|
summary: ops_team handles basic automation for your project, driven by self-documenting
|
data/bin/ops.orig
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
5
|
-
|
6
|
-
require_relative '../lib/profiler'
|
7
|
-
require 'optparse'
|
8
|
-
|
9
|
-
def usage
|
10
|
-
puts "Usage: ops [-f|--file <ops_yml>] action [<action args>"
|
11
|
-
puts " ops_yml: the config file to load instead of './ops.yml'"
|
12
|
-
puts " action_args: arguments to the action loaded from the config file; depends on the action"
|
13
|
-
|
14
|
-
exit(1)
|
15
|
-
end
|
16
|
-
|
17
|
-
options = {}
|
18
|
-
status = -1
|
19
|
-
|
20
|
-
while ARGV[0]&.match(/^-/)
|
21
|
-
opt = ARGV.shift
|
22
|
-
case opt
|
23
|
-
when '-f', '--file'
|
24
|
-
usage unless ARGV.length >= 1
|
25
|
-
|
26
|
-
options[:file] = ARGV.shift
|
27
|
-
else
|
28
|
-
usage
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
Profiler.measure("bin:require") do
|
33
|
-
require_relative "../loader"
|
34
|
-
end
|
35
|
-
|
36
|
-
Profiler.measure("bin:run") do
|
37
|
-
status = Ops.new(ARGV, config_file: options[:file]).run
|
38
|
-
end
|
39
|
-
|
40
|
-
Profiler.add_measurement("bin:all", Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time)
|
41
|
-
Output.error(Profiler.summary) if Profiler.summary
|
42
|
-
exit status
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "tempfile"
|
4
|
-
|
5
|
-
module Dependencies
|
6
|
-
module Helpers
|
7
|
-
class SshKeyDecryptor
|
8
|
-
def initialize(source_key_path, passphrase)
|
9
|
-
@source_key_path = source_key_path
|
10
|
-
@passphrase = passphrase
|
11
|
-
end
|
12
|
-
|
13
|
-
def plaintext_key
|
14
|
-
@plaintext_key ||= begin
|
15
|
-
plaintext = decrypt_key
|
16
|
-
|
17
|
-
File.delete(temp_key_file.path)
|
18
|
-
|
19
|
-
plaintext
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def temp_key_file
|
26
|
-
@temp_key_file ||= Tempfile.new("ops")
|
27
|
-
end
|
28
|
-
|
29
|
-
def decrypt_key
|
30
|
-
FileUtils.cp(@source_key_path, temp_key_file.path)
|
31
|
-
`ssh-keygen -f '#{temp_key_file.path}' -p -P '#{@passphrase}' </dev/null`
|
32
|
-
|
33
|
-
File.read(temp_key_file.path)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|