pipe_fitter 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -0
- data/exe/pipe_fitter +0 -97
- data/lib/pipe_fitter/cli.rb +97 -0
- data/lib/pipe_fitter/pipeline.rb +1 -1
- data/lib/pipe_fitter/version.rb +1 -1
- data/lib/pipe_fitter.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57e2a796254d92b989009e5136a89dc470926ad62bf2430fdb17832bb3dfa678
|
4
|
+
data.tar.gz: 3f41226aae8456caab45a13b34e0f8678d24b2456150f4ae6980b17730693ff2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c88c58acd22b40bf4428e3ba07b4faaf7e5cee4483e6de13ada3ae547f9050955fbf21bc0567a19e4cb2725f3ec770322604f65555b6b6b8b074f56b1274747
|
7
|
+
data.tar.gz: d472387e2b9a66c3fc20fbb1c6f031efa97e73bbda671dc868e9fd8ee5d7931189e07ad2dfebbb974e3f6ae004a871cac55a25a112aa1f132ca057975f9fa925
|
data/.github/workflows/test.yml
CHANGED
data/exe/pipe_fitter
CHANGED
@@ -1,102 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "pipe_fitter"
|
4
|
-
require "thor"
|
5
|
-
|
6
|
-
module PipeFitter
|
7
|
-
class Cli < Thor
|
8
|
-
class_option :region, type: :string
|
9
|
-
class_option :profile, type: :string
|
10
|
-
|
11
|
-
desc "export", "Export pipeline definition"
|
12
|
-
option :pipeline_id, type: :string, required: true, aliases: "i"
|
13
|
-
def export
|
14
|
-
puts client.definition(options[:pipeline_id]).to_yaml
|
15
|
-
end
|
16
|
-
|
17
|
-
desc "register DEFINITION_FILE", "Register pipeline"
|
18
|
-
def register(definition_file)
|
19
|
-
id, res = client.register(definition_file)
|
20
|
-
puts id, JSON.pretty_generate(res)
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "diff DEFINITION_FILE", "Show pipeline difference"
|
24
|
-
option :pipeline_id, type: :string, required: true, aliases: "i"
|
25
|
-
option :format, type: :string, default: "color", aliases: "f"
|
26
|
-
def diff(definition_file)
|
27
|
-
puts client.diff(options[:pipeline_id], definition_file, options[:format])
|
28
|
-
end
|
29
|
-
|
30
|
-
desc "update DEFINITION_FILE", "Update pipeline definition"
|
31
|
-
option :pipeline_id, type: :string, required: true, aliases: "i"
|
32
|
-
def update(definition_file)
|
33
|
-
res = client.update(options[:pipeline_id], definition_file)
|
34
|
-
puts JSON.pretty_generate(res)
|
35
|
-
end
|
36
|
-
|
37
|
-
desc "activate", "Activate pipeline"
|
38
|
-
option :pipeline_id, type: :string, required: true, aliases: "i"
|
39
|
-
option :parameter_file, type: :string, required: false, aliases: "p"
|
40
|
-
option :start_timestamp, type: :string, required: false, aliases: "t"
|
41
|
-
def activate
|
42
|
-
t = options[:start_timestamp] ? Time.parse(options[:start_timestamp]) : nil
|
43
|
-
puts client.activate(options[:pipeline_id], options[:parameter_file], t)
|
44
|
-
end
|
45
|
-
|
46
|
-
desc "show", "Show pipeline setting in YAML format"
|
47
|
-
option :parameter_file, type: :string, required: false, aliases: "p"
|
48
|
-
def show(definition_file)
|
49
|
-
puts Pipeline.load_yaml(definition_file).to_yaml
|
50
|
-
end
|
51
|
-
|
52
|
-
desc "find", "Find pipeline besed on name and uniqueId"
|
53
|
-
def find(definition_file)
|
54
|
-
puts client.find_registered(definition_file).to_h.to_json
|
55
|
-
end
|
56
|
-
|
57
|
-
desc "find_diff", "Find pipeline besed on name and uniqueId, show diff"
|
58
|
-
option :format, type: :string, default: "color", aliases: "f"
|
59
|
-
def find_diff(definition_file)
|
60
|
-
p = client.find_registered(definition_file)
|
61
|
-
abort("Pipeline is not registered") if p.nil?
|
62
|
-
puts client.diff(p.id, definition_file, options[:format])
|
63
|
-
puts p.to_h.to_json
|
64
|
-
end
|
65
|
-
|
66
|
-
desc "find_update", "Find pipeline besed on name and uniqueId, update pipeline definition"
|
67
|
-
option :force_update, type: :boolean, aliases: "f"
|
68
|
-
def find_update(definition_file)
|
69
|
-
p = client.find_registered(definition_file)
|
70
|
-
abort("Pipeline is not registered") if p.nil?
|
71
|
-
unless options[:force_update]
|
72
|
-
puts client.diff(p.id, definition_file)
|
73
|
-
print "\nReally update pipeline definition? [y/N] : "
|
74
|
-
abort("Update was canceled") if $stdin.gets.chomp !~ /^y$/i
|
75
|
-
end
|
76
|
-
res = client.update(p.id, definition_file)
|
77
|
-
puts JSON.pretty_generate(res)
|
78
|
-
puts p.to_h.to_json
|
79
|
-
end
|
80
|
-
|
81
|
-
desc "diff_deploy_files DEFINITION_FILE", "Show deploy files differences"
|
82
|
-
option :format, type: :string, default: "color", aliases: "f"
|
83
|
-
def diff_deploy_files(definition_file)
|
84
|
-
client.diff_deploy_files(definition_file, options[:format]).each do |d|
|
85
|
-
puts d
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
desc "upload_deploy_files DEFINITION_FILE", "Upload deploy files"
|
90
|
-
def upload_deploy_files(definition_file)
|
91
|
-
client.upload_deploy_files(definition_file)
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def client
|
97
|
-
@client ||= DataPipelineClient.new(options)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
4
|
|
102
5
|
PipeFitter::Cli.start
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
module PipeFitter
|
4
|
+
class Cli < Thor
|
5
|
+
class_option :region, type: :string
|
6
|
+
class_option :profile, type: :string
|
7
|
+
|
8
|
+
desc "export", "Export pipeline definition"
|
9
|
+
option :pipeline_id, type: :string, required: true, aliases: "i"
|
10
|
+
def export
|
11
|
+
puts client.definition(options[:pipeline_id]).to_yaml
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "register DEFINITION_FILE", "Register pipeline"
|
15
|
+
def register(definition_file)
|
16
|
+
id, res = client.register(definition_file)
|
17
|
+
puts id, JSON.pretty_generate(res)
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "diff DEFINITION_FILE", "Show pipeline difference"
|
21
|
+
option :pipeline_id, type: :string, required: true, aliases: "i"
|
22
|
+
option :format, type: :string, default: "color", aliases: "f"
|
23
|
+
def diff(definition_file)
|
24
|
+
puts client.diff(options[:pipeline_id], definition_file, options[:format])
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "update DEFINITION_FILE", "Update pipeline definition"
|
28
|
+
option :pipeline_id, type: :string, required: true, aliases: "i"
|
29
|
+
def update(definition_file)
|
30
|
+
res = client.update(options[:pipeline_id], definition_file)
|
31
|
+
puts JSON.pretty_generate(res)
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "activate", "Activate pipeline"
|
35
|
+
option :pipeline_id, type: :string, required: true, aliases: "i"
|
36
|
+
option :parameter_file, type: :string, required: false, aliases: "p"
|
37
|
+
option :start_timestamp, type: :string, required: false, aliases: "t"
|
38
|
+
def activate
|
39
|
+
t = options[:start_timestamp] ? Time.parse(options[:start_timestamp]) : nil
|
40
|
+
puts client.activate(options[:pipeline_id], options[:parameter_file], t)
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "show", "Show pipeline setting in YAML format"
|
44
|
+
option :parameter_file, type: :string, required: false, aliases: "p"
|
45
|
+
def show(definition_file)
|
46
|
+
puts Pipeline.load_yaml(definition_file).to_yaml
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "find", "Find pipeline besed on name and uniqueId"
|
50
|
+
def find(definition_file)
|
51
|
+
puts client.find_registered(definition_file).to_h.to_json
|
52
|
+
end
|
53
|
+
|
54
|
+
desc "find_diff", "Find pipeline besed on name and uniqueId, show diff"
|
55
|
+
option :format, type: :string, default: "color", aliases: "f"
|
56
|
+
def find_diff(definition_file)
|
57
|
+
p = client.find_registered(definition_file)
|
58
|
+
abort("Pipeline is not registered") if p.nil?
|
59
|
+
puts client.diff(p.id, definition_file, options[:format])
|
60
|
+
puts p.to_h.to_json
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "find_update", "Find pipeline besed on name and uniqueId, update pipeline definition"
|
64
|
+
option :force_update, type: :boolean, aliases: "f"
|
65
|
+
def find_update(definition_file)
|
66
|
+
p = client.find_registered(definition_file)
|
67
|
+
abort("Pipeline is not registered") if p.nil?
|
68
|
+
unless options[:force_update]
|
69
|
+
puts client.diff(p.id, definition_file)
|
70
|
+
print "\nReally update pipeline definition? [y/N] : "
|
71
|
+
abort("Update was canceled") if $stdin.gets.chomp !~ /^y$/i
|
72
|
+
end
|
73
|
+
res = client.update(p.id, definition_file)
|
74
|
+
puts JSON.pretty_generate(res)
|
75
|
+
puts p.to_h.to_json
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "diff_deploy_files DEFINITION_FILE", "Show deploy files differences"
|
79
|
+
option :format, type: :string, default: "color", aliases: "f"
|
80
|
+
def diff_deploy_files(definition_file)
|
81
|
+
client.diff_deploy_files(definition_file, options[:format]).each do |d|
|
82
|
+
puts d
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
desc "upload_deploy_files DEFINITION_FILE", "Upload deploy files"
|
87
|
+
def upload_deploy_files(definition_file)
|
88
|
+
client.upload_deploy_files(definition_file)
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
def client
|
94
|
+
@client ||= DataPipelineClient.new(options)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/lib/pipe_fitter/pipeline.rb
CHANGED
data/lib/pipe_fitter/version.rb
CHANGED
data/lib/pipe_fitter.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipe_fitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- masa21kik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- bin/setup
|
198
198
|
- exe/pipe_fitter
|
199
199
|
- lib/pipe_fitter.rb
|
200
|
+
- lib/pipe_fitter/cli.rb
|
200
201
|
- lib/pipe_fitter/data_pipeline_client.rb
|
201
202
|
- lib/pipe_fitter/pipeline.rb
|
202
203
|
- lib/pipe_fitter/version.rb
|