tomo 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tomo/runtime/no_tasks_error.rb +18 -0
- data/lib/tomo/runtime.rb +7 -0
- data/lib/tomo/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59101ab95fe3349e1019733d4ddc505f6a67751e8753d43856ecbc7d7bff06f8
|
4
|
+
data.tar.gz: ecbe502eb8169d0112935da329f6202c098686f8b16a98c170de1960ce34c01f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dea219c2e0c1d2ddc4ad61390bc8791ff87f7ed2a412b16f74a58040e496eaf1b113b3e37556d8d39e7379fcf3acf779d03fa9cf806b40b74e20769f1bc7c57
|
7
|
+
data.tar.gz: cd779d65cd9c1ccbe67d619cfc2ca67bcace68277aebc812099ef20138eaf939eea8190750d69ae155ee31e500d34850c4d4e1e07cc93b9871d1ab4ff8e62914
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Tomo
|
2
|
+
class Runtime
|
3
|
+
class NoTasksError < Error
|
4
|
+
attr_accessor :task_type
|
5
|
+
|
6
|
+
def to_console
|
7
|
+
<<~ERROR
|
8
|
+
No #{task_type} tasks are configured.
|
9
|
+
You can specify them using a #{yellow(task_type)} block in #{yellow(Tomo::DEFAULT_CONFIG_PATH)}.
|
10
|
+
|
11
|
+
More configuration documentation and examples can be found here:
|
12
|
+
|
13
|
+
#{blue('https://tomo-deploy.com/configuration')}
|
14
|
+
ERROR
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/tomo/runtime.rb
CHANGED
@@ -10,6 +10,7 @@ module Tomo
|
|
10
10
|
autoload :ExecutionPlan, "tomo/runtime/execution_plan"
|
11
11
|
autoload :HostExecutionStep, "tomo/runtime/host_execution_step"
|
12
12
|
autoload :InlineThreadPool, "tomo/runtime/inline_thread_pool"
|
13
|
+
autoload :NoTasksError, "tomo/runtime/no_tasks_error"
|
13
14
|
autoload :PrivilegedTask, "tomo/runtime/privileged_task"
|
14
15
|
autoload :SettingsInterpolation, "tomo/runtime/settings_interpolation"
|
15
16
|
autoload :SettingsRequiredError, "tomo/runtime/settings_required_error"
|
@@ -32,10 +33,14 @@ module Tomo
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def deploy!
|
36
|
+
NoTasksError.raise_with(task_type: "deploy") if deploy_tasks.empty?
|
37
|
+
|
35
38
|
execution_plan_for(deploy_tasks, release: :new).execute
|
36
39
|
end
|
37
40
|
|
38
41
|
def setup!
|
42
|
+
NoTasksError.raise_with(task_type: "setup") if setup_tasks.empty?
|
43
|
+
|
39
44
|
execution_plan_for(setup_tasks, release: :tmp).execute
|
40
45
|
end
|
41
46
|
|
@@ -45,6 +50,8 @@ module Tomo
|
|
45
50
|
end
|
46
51
|
|
47
52
|
def execution_plan_for(tasks, release: :current, args: [])
|
53
|
+
raise ArgumentError, "tasks cannot be empty" if tasks.empty?
|
54
|
+
|
48
55
|
ExecutionPlan.new(
|
49
56
|
tasks: tasks,
|
50
57
|
hosts: hosts,
|
data/lib/tomo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.4.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.4.0
|
139
139
|
description:
|
140
140
|
email:
|
141
141
|
- opensource@mattbrictson.com
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- lib/tomo/runtime/execution_plan.rb
|
240
240
|
- lib/tomo/runtime/host_execution_step.rb
|
241
241
|
- lib/tomo/runtime/inline_thread_pool.rb
|
242
|
+
- lib/tomo/runtime/no_tasks_error.rb
|
242
243
|
- lib/tomo/runtime/privileged_task.rb
|
243
244
|
- lib/tomo/runtime/settings_interpolation.rb
|
244
245
|
- lib/tomo/runtime/settings_required_error.rb
|
@@ -301,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
302
|
- !ruby/object:Gem::Version
|
302
303
|
version: '0'
|
303
304
|
requirements: []
|
304
|
-
rubygems_version: 3.0.
|
305
|
+
rubygems_version: 3.0.4
|
305
306
|
signing_key:
|
306
307
|
specification_version: 4
|
307
308
|
summary: A simple SSH-based deployment tool, built for Rails
|