tomo 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f646a8ad8b9a55a908ead2765b2b48461f279328424ffae5ddd71adbf525099
4
- data.tar.gz: 07b17c07811315a55e49e8b8e0e5d30f56ff88a618fc8ba8053c147f53fa0289
3
+ metadata.gz: a949853f699c7d894efa675295a631ddb1ebd0ba04e900fa4efdea449d4288d7
4
+ data.tar.gz: 745d7827bcb35a468de96aadb74c0fdc7971074f82b5b3965a7f76e75962d19b
5
5
  SHA512:
6
- metadata.gz: 1a28e6dcdf0ae942ade3eccad7d3c4cf2b8bc8ae1b843fb342d6bb15b35dacda4e07447a9d68cc7ccbe401bb3665fc48ac3ad82a1c0cf21c3d38b20151d52581
7
- data.tar.gz: 7ed26ba43d56e602c8aebc59c29900ac53174c8dbf781cc357a16ad5cf5d7581caadd706d5efb4fc6befc30830dba6c322fb9e1910b3cfbfca5573d9bf962c0c
6
+ metadata.gz: b2b129d2422bf0e5fd22ed2d693d73bd7552d70f57fc2381206987fd69cbda811f1121304397a23a0a8db5ac26bb1c807a658506672bfa80ee765b5abd13103f
7
+ data.tar.gz: 2217e9de8c4f4445343297afc51c661a986d5cca5a61c718569efec1f23557200f4ab64585203a99380fa50373beeeec3ff772bc10d7d6d556e6a5867649e0d6
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
@@ -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)
@@ -31,8 +31,7 @@ module Tomo::Plugin::Nodenv
31
31
  end
32
32
 
33
33
  def install_node
34
- require_setting :nodenv_node_version
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
@@ -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" %>
@@ -1,4 +1,4 @@
1
- FROM ubuntu:20.04
1
+ FROM ubuntu:22.04
2
2
  WORKDIR /provision
3
3
  COPY ./tomo_test_ed25519.pub /root/.ssh/authorized_keys
4
4
  COPY ./ubuntu_setup.sh ./
@@ -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:20.04')
73
- Local.capture("docker pull ubuntu:20.04") if images.strip.empty?
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
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.11.0".freeze
2
+ VERSION = "1.12.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: 1.11.0
4
+ version: 1.12.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: 2022-02-26 00:00:00.000000000 Z
11
+ date: 2022-06-18 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
@@ -182,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - ">="
184
184
  - !ruby/object:Gem::Version
185
- version: 2.6.0
185
+ version: '2.6'
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  requirements:
188
188
  - - ">="
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.3.7
192
+ rubygems_version: 3.3.16
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: A friendly CLI for deploying Rails apps ✨