mikoshi 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mikoshi/cli.rb +26 -0
- data/lib/mikoshi/plan/task_definition.rb +6 -0
- data/lib/mikoshi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07ee0e950e881ccf43b42fb0528695f1d229cff
|
4
|
+
data.tar.gz: 1e9bf381a69bee72be583f4437e3876c83b3272b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e31bf93102661b0ae4e3344866afb4c38eb0b801a4e2a2fbee7dc6d4e7cc695f12e4b0fc390875df43e35ca752fdeaef8691e55d4c9804523f64a7385b7e6cb
|
7
|
+
data.tar.gz: 6fa9a70fa1d52549d53c4dfb6b68009a02578c3e9264d50538a096b2817343b8612e3a8ab48678b2ba6f09ce5daab73445c076f6752c59016e2f7df89df25fcd
|
data/lib/mikoshi/cli.rb
CHANGED
@@ -35,6 +35,8 @@ module Mikoshi
|
|
35
35
|
update_task_definition(@options[:config][:task_definition] || @argv[1])
|
36
36
|
when :update_service
|
37
37
|
update_service(@options[:config][:service] || @argv[1])
|
38
|
+
when :runtask
|
39
|
+
runtask(@options[:config][:task_definition] || @argv[1], @options[:config][:cluster])
|
38
40
|
when :deploy
|
39
41
|
deploy
|
40
42
|
when :version
|
@@ -54,6 +56,7 @@ module Mikoshi
|
|
54
56
|
opt.on('-g', '--group=GROUP') { |v| @options[:config][:group] = v }
|
55
57
|
opt.on('-h', '--help') { |v| @options[:config][:help] = v }
|
56
58
|
opt.on('-v', '--version') { |v| @options[:config][:version] = v }
|
59
|
+
opt.on('--cluster=CLUSTER') { |v| @options[:config][:cluster] = v }
|
57
60
|
|
58
61
|
opt.permute!(@argv)
|
59
62
|
@options[:command] = @argv.first.to_sym unless @argv.first.nil?
|
@@ -83,6 +86,13 @@ module Mikoshi
|
|
83
86
|
--potdr
|
84
87
|
Acronym of the "Print Only Task Definition Revision".
|
85
88
|
|
89
|
+
runtask
|
90
|
+
Invoke new task using specified task definition.
|
91
|
+
|
92
|
+
Option
|
93
|
+
--cluster
|
94
|
+
Set cluster to run task. (required)
|
95
|
+
|
86
96
|
update_service
|
87
97
|
Update service to given service yaml file.
|
88
98
|
Wait for success to update the service. (Maximum 300 min)
|
@@ -125,6 +135,22 @@ module Mikoshi
|
|
125
135
|
puts ENV['TASK_DEF_REVISION'] if potdr
|
126
136
|
end
|
127
137
|
|
138
|
+
def runtask(task_def_name, cluster)
|
139
|
+
if task_def_name.nil?
|
140
|
+
warn '--task-definition=TASK_DEFINITION is require option.'
|
141
|
+
abort
|
142
|
+
end
|
143
|
+
|
144
|
+
task = ::Mikoshi::Plan::TaskDefinition.new(
|
145
|
+
yaml_path: File.join(TASK_DEFINITION_PATH, task_def_name + PLAN_EXT),
|
146
|
+
client: aws_client,
|
147
|
+
)
|
148
|
+
|
149
|
+
puts "Run task: #{task_def_name}"
|
150
|
+
task.runtask(cluster: cluster)
|
151
|
+
puts "Invoked task: #{task_def_name}"
|
152
|
+
end
|
153
|
+
|
128
154
|
def update_service(service_name)
|
129
155
|
if service_name.nil?
|
130
156
|
warn '--service=SERVICE is require option.'
|
@@ -23,6 +23,12 @@ module Mikoshi
|
|
23
23
|
raise e
|
24
24
|
end
|
25
25
|
|
26
|
+
def runtask(cluster: nil)
|
27
|
+
raise ArgumentError, 'cluster name is required.' if cluster.nil?
|
28
|
+
|
29
|
+
resp = @client.run_task(task_definition: @data[:task_definition][:family], cluster: cluster)
|
30
|
+
end
|
31
|
+
|
26
32
|
private
|
27
33
|
|
28
34
|
%w[before after].each do |step|
|
data/lib/mikoshi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mikoshi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|