tomo 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a195d5ca53b88b0bb0b79a013fdf0526f4bbbca8d9e700960e4e055e9e82b520
4
- data.tar.gz: 01f8f89d2bf321858481ec4581bce9c786ca461ebc4ddf730b9e984b94d904e1
3
+ metadata.gz: 59101ab95fe3349e1019733d4ddc505f6a67751e8753d43856ecbc7d7bff06f8
4
+ data.tar.gz: ecbe502eb8169d0112935da329f6202c098686f8b16a98c170de1960ce34c01f
5
5
  SHA512:
6
- metadata.gz: 7f59074b4183c57008dd6c15d05dc7c1acdb5b07c4836ab21ef4da4df10d7718af2e6e758873920a226b95dcba432a14bbb1c24a0938967a061a54de28ef20c2
7
- data.tar.gz: 15c1f50a0d2843c055421bc3f345c0a08530c15aaf85bd3bff48ac059d299ee9eff346ce7ced1c594cc30f27b6750a587124e5f69805d9bedecd67f8adfd8971
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
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
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.1.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-17 00:00:00.000000000 Z
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.3.0
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.3.0
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.3
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