tomo 1.10.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +4 -0
- data/lib/tomo/commands/init.rb +10 -0
- data/lib/tomo/configuration/plugins_registry.rb +1 -4
- data/lib/tomo/path.rb +1 -1
- data/lib/tomo/plugin/git/tasks.rb +11 -6
- data/lib/tomo/plugin/git.rb +3 -1
- data/lib/tomo/plugin/nodenv/tasks.rb +12 -2
- data/lib/tomo/runtime/current.rb +1 -1
- data/lib/tomo/runtime/execution_plan.rb +1 -2
- data/lib/tomo/runtime/settings_interpolation.rb +1 -1
- data/lib/tomo/ssh/child_process.rb +1 -0
- data/lib/tomo/templates/config.rb.erb +3 -0
- data/lib/tomo/testing/Dockerfile +1 -1
- data/lib/tomo/testing/docker_image.rb +2 -2
- data/lib/tomo/testing/log_capturing.rb +2 -0
- data/lib/tomo/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9142456e11c3c6f0f98da45c6b25f72ffb9e3e1f82c17dff873e1c089e1a109e
|
4
|
+
data.tar.gz: a696e761b09568dd567fdbf02ed12cc135affe4fcf0bea27a28994a3133a9f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949eb42bc30edb68b82e7f2a352f80eb19519faaef9935f9c910984cc2e915241ce85e9602e28e26fd9cbdae99b215094d2932a02462e379c7ea2674b591eb32
|
7
|
+
data.tar.gz: 7525b76d9ee72a93b511ff815167a5188fe818b17f004c4236f1620ddded762e08b0bb215af709c23ce96df8f4992239c34ec778a269f7685d45a663e67d141d
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -240,6 +240,10 @@ host "app2@example.com"
|
|
240
240
|
|
241
241
|
Next run `tomo setup` for _both_ apps; this will set everything up for both users on the remote host (environment variables, rbenv, etc.). You can now deploy both apps to the same host, with the confidence that their configurations will be kept cleanly separated.
|
242
242
|
|
243
|
+
#### Does tomo support git submodules?
|
244
|
+
|
245
|
+
No, not out of the box. However, you can extend tomo with an additional task for submodules; see the solution in [PR #220](https://github.com/mattbrictson/tomo/pull/220#pullrequestreview-979249573) suggested by [@numbcoder](https://github.com/numbcoder).
|
246
|
+
|
243
247
|
## Support
|
244
248
|
|
245
249
|
This project is a labor of love and I can only spend a few hours a week maintaining it, at most. If you'd like to help by submitting a pull request, or if you've discovered a bug that needs my attention, please let me know. Check out [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/main/CONTRIBUTING.md) to get started. Happy hacking! —Matt
|
data/lib/tomo/commands/init.rb
CHANGED
@@ -104,6 +104,16 @@ module Tomo
|
|
104
104
|
false
|
105
105
|
end
|
106
106
|
|
107
|
+
# Does a .node-version file exist match `node --version`?
|
108
|
+
def using_node_version_file?
|
109
|
+
return false unless File.exist?(".node-version")
|
110
|
+
|
111
|
+
version = File.read(".node-version").rstrip
|
112
|
+
!version.empty? && version == node_version
|
113
|
+
rescue IOError
|
114
|
+
false
|
115
|
+
end
|
116
|
+
|
107
117
|
def config_rb_template(app)
|
108
118
|
path = File.expand_path("../templates/config.rb.erb", __dir__)
|
109
119
|
template = File.read(path)
|
@@ -55,10 +55,7 @@ module Tomo
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def register_task_library(namespace, library_class)
|
58
|
-
Tomo.logger.debug(
|
59
|
-
"Registering task library #{library_class}"\
|
60
|
-
" (#{namespace.inspect} namespace)"
|
61
|
-
)
|
58
|
+
Tomo.logger.debug("Registering task library #{library_class} (#{namespace.inspect} namespace)")
|
62
59
|
namespaced_classes << [namespace, library_class]
|
63
60
|
end
|
64
61
|
end
|
data/lib/tomo/path.rb
CHANGED
@@ -3,6 +3,14 @@ require "time"
|
|
3
3
|
|
4
4
|
module Tomo::Plugin::Git
|
5
5
|
class Tasks < Tomo::TaskLibrary
|
6
|
+
def config
|
7
|
+
user_name = settings[:git_user_name] || remote.host.user
|
8
|
+
user_email = settings[:git_user_email] || "#{remote.host.user}@example.com"
|
9
|
+
|
10
|
+
remote.git("config", "--global", "user.name", user_name)
|
11
|
+
remote.git("config", "--global", "user.email", user_email)
|
12
|
+
end
|
13
|
+
|
6
14
|
def clone
|
7
15
|
require_setting :git_url
|
8
16
|
|
@@ -24,10 +32,7 @@ module Tomo::Plugin::Git
|
|
24
32
|
remote.mkdir_p(paths.release)
|
25
33
|
|
26
34
|
remote.chdir(paths.git_repo) do
|
27
|
-
remote.git(
|
28
|
-
"archive #{ref.shellescape} | "\
|
29
|
-
"tar -x -f - -C #{paths.release.shellescape}"
|
30
|
-
)
|
35
|
+
remote.git("archive #{ref.shellescape} | tar -x -f - -C #{paths.release.shellescape}")
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
@@ -45,8 +50,8 @@ module Tomo::Plugin::Git
|
|
45
50
|
return unless settings[:git_ref] && settings[:git_branch]
|
46
51
|
|
47
52
|
logger.warn(
|
48
|
-
":git_ref (#{settings[:git_ref]}) and "\
|
49
|
-
":git_branch (#{settings[:git_branch]}) are both specified. "\
|
53
|
+
":git_ref (#{settings[:git_ref]}) and " \
|
54
|
+
":git_branch (#{settings[:git_branch]}) are both specified. " \
|
50
55
|
"Ignoring :git_branch."
|
51
56
|
)
|
52
57
|
@ref_override_warning = true
|
data/lib/tomo/plugin/git.rb
CHANGED
@@ -31,8 +31,7 @@ module Tomo::Plugin::Nodenv
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def install_node
|
34
|
-
|
35
|
-
node_version = settings[:nodenv_node_version]
|
34
|
+
node_version = settings[:nodenv_node_version] || extract_node_ver_from_version_file
|
36
35
|
|
37
36
|
remote.run "nodenv install #{node_version.shellescape}" unless node_installed?(node_version)
|
38
37
|
remote.run "nodenv global #{node_version.shellescape}"
|
@@ -57,5 +56,16 @@ module Tomo::Plugin::Nodenv
|
|
57
56
|
end
|
58
57
|
false
|
59
58
|
end
|
59
|
+
|
60
|
+
def extract_node_ver_from_version_file
|
61
|
+
path = paths.release.join(".node-version")
|
62
|
+
version = remote.capture("cat", path, raise_on_error: false).strip
|
63
|
+
return version unless version.empty?
|
64
|
+
|
65
|
+
die <<~REASON
|
66
|
+
Could not guess node version from .node-version file.
|
67
|
+
Use the :nodenv_node_version setting to specify the version of node to install.
|
68
|
+
REASON
|
69
|
+
end
|
60
70
|
end
|
61
71
|
end
|
data/lib/tomo/runtime/current.rb
CHANGED
@@ -26,8 +26,7 @@ module Tomo
|
|
26
26
|
when 1 then applicable_hosts.first.to_s
|
27
27
|
when 2 then applicable_hosts.map(&:to_s).join(" and ")
|
28
28
|
else
|
29
|
-
"#{applicable_hosts.first} and "
|
30
|
-
"#{applicable_hosts.length - 1} other hosts"
|
29
|
+
"#{applicable_hosts.first} and #{applicable_hosts.length - 1} other hosts"
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
@@ -17,7 +17,9 @@ set deploy_to: "/var/www/%{application}"
|
|
17
17
|
<% unless using_ruby_version_file? -%>
|
18
18
|
set rbenv_ruby_version: <%= RUBY_VERSION.inspect %>
|
19
19
|
<% end -%>
|
20
|
+
<% unless using_node_version_file? -%>
|
20
21
|
set nodenv_node_version: <%= node_version&.inspect || "nil # FIXME" %>
|
22
|
+
<% end -%>
|
21
23
|
set nodenv_install_yarn: <%= yarn_version ? "true" : "false" %>
|
22
24
|
set git_url: <%= git_origin_url&.inspect || "nil # FIXME" %>
|
23
25
|
set git_branch: <%= git_branch&.inspect || "nil # FIXME" %>
|
@@ -49,6 +51,7 @@ set linked_dirs: %w[
|
|
49
51
|
setup do
|
50
52
|
run "env:setup"
|
51
53
|
run "core:setup_directories"
|
54
|
+
run "git:config"
|
52
55
|
run "git:clone"
|
53
56
|
run "git:create_release"
|
54
57
|
run "core:symlink_shared"
|
data/lib/tomo/testing/Dockerfile
CHANGED
@@ -69,8 +69,8 @@ module Tomo
|
|
69
69
|
attr_reader :container_id, :image_id, :private_key_path
|
70
70
|
|
71
71
|
def pull_base_image_if_needed
|
72
|
-
images = Local.capture('docker images --format "{{.ID}}" ubuntu:
|
73
|
-
Local.capture("docker pull ubuntu:
|
72
|
+
images = Local.capture('docker images --format "{{.ID}}" ubuntu:22.04')
|
73
|
+
Local.capture("docker pull ubuntu:22.04") if images.strip.empty?
|
74
74
|
end
|
75
75
|
|
76
76
|
def set_up_private_key
|
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: 1.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Tomo is a feature-rich deployment tool that contains everything you need
|
14
14
|
to deploy a basic Rails app out of the box. It has an opinionated, production-tested
|
@@ -173,6 +173,7 @@ metadata:
|
|
173
173
|
source_code_uri: https://github.com/mattbrictson/tomo
|
174
174
|
homepage_uri: https://github.com/mattbrictson/tomo
|
175
175
|
documentation_uri: https://tomo-deploy.com/
|
176
|
+
rubygems_mfa_required: 'true'
|
176
177
|
post_install_message:
|
177
178
|
rdoc_options: []
|
178
179
|
require_paths:
|
@@ -181,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
182
|
requirements:
|
182
183
|
- - ">="
|
183
184
|
- !ruby/object:Gem::Version
|
184
|
-
version: 2.6
|
185
|
+
version: '2.6'
|
185
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
187
|
requirements:
|
187
188
|
- - ">="
|
188
189
|
- !ruby/object:Gem::Version
|
189
190
|
version: '0'
|
190
191
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.3.18
|
192
193
|
signing_key:
|
193
194
|
specification_version: 4
|
194
195
|
summary: A friendly CLI for deploying Rails apps ✨
|