tomo 0.14.0 → 0.14.1

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: fccccb439486dd6a01d1ae1c4fd89a00449847275c4510dae1e8de286c21d875
4
- data.tar.gz: 249c53ba5dcbc1592fcf8ba1c45212dd97c2dbb018ca88b5d6d5a12dcd401895
3
+ metadata.gz: 3cbbf974be9564d4c3a62f37c35168b6bb843d7795713747a4ed61e8900e1dfc
4
+ data.tar.gz: 0c9d63948b5685c078e7e29516361aedb92bca506f8d288dd2dcb6b7167c9f4f
5
5
  SHA512:
6
- metadata.gz: a0638893655f98866b04052ca6d512a42d5f56e6cde2a3798b6e5009ac8cff4fe65561159f22aa8791399bd89dc07a12b904a761c921eeba5eb7d5a054545645
7
- data.tar.gz: e15be0b3b72f5f50733bda37bf5012e7a16b0c4abfff7a2b3f248c87008437df54f4c920846bf07b03368c3745bfe052e7f85819fd408ab758bd24bb3fb0d21d
6
+ metadata.gz: f1dac487e03b17256a35565d150ae6da864ef36d7770e7eaceca41b49411445809ba7c1e4e30d9fd7e89cbc1020a986c179710b32a87d681953dc35747f57379
7
+ data.tar.gz: bc052619039101ca8383aad67e26c330300ae1819432e381a978660e17cd525e4bb5a91cf65ae211c50abf15688e85c78bbb66ceb028c1aaa0db15e977410c05
data/README.md CHANGED
@@ -204,6 +204,26 @@ By default, tomo uses the ["accept-new"](https://www.openssh.com/txt/release-7.6
204
204
  set ssh_strict_host_key_checking: true # or false
205
205
  ```
206
206
 
207
+ #### Can I deploy multiple apps to a single host?
208
+
209
+ Tomo relies on the host user's bash profile for various things, like setting environment variables and initializing rbenv and nodenv. This makes it impractical to deploy multiple apps to a single host using the same deploy user.
210
+
211
+ The solution is to create multiple users on the remote host, and then configure a different user for deploying each app. That way each user can have its own distinct environment variables and you can easily configure each app differently without risking conflicts. Refer to the [tomo Rails tutorial](https://tomo-deploy.com/tutorials/deploying-rails-from-scratch/#set-up-a-deployer-user) for instructions on creating a deploy user.
212
+
213
+ E.g. app1 would be configured to deploy as:
214
+
215
+ ```ruby
216
+ host "app1@example.com"
217
+ ```
218
+
219
+ And app2 would be configured to deploy as:
220
+
221
+ ```ruby
222
+ host "app2@example.com"
223
+ ```
224
+
225
+ 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.
226
+
207
227
  ## Support
208
228
 
209
229
  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/master/CONTRIBUTING.md) to get started. Happy hacking! —Matt
@@ -34,6 +34,7 @@ module Tomo
34
34
 
35
35
  set_up_build_dir
36
36
  pull_base_image_if_needed
37
+ set_up_private_key
37
38
  @image_id = build_image
38
39
  @container_id = start_container
39
40
  @host = Host.parse("deployer@localhost", port: find_ssh_port)
@@ -59,13 +60,10 @@ module Tomo
59
60
  # for storing known_hosts.
60
61
  def ssh_settings
61
62
  hosts_file = File.join(Dir.tmpdir, "tomo_#{SecureRandom.hex(8)}_hosts")
62
- key_file = File.expand_path("tomo_test_ed25519", __dir__)
63
- FileUtils.chmod(0o600, key_file)
64
-
65
63
  {
66
64
  ssh_extra_opts: [
67
65
  "-o", "UserKnownHostsFile=#{hosts_file}",
68
- "-o", "IdentityFile=#{key_file}"
66
+ "-o", "IdentityFile=#{private_key_path}"
69
67
  ],
70
68
  ssh_strict_host_key_checking: false
71
69
  }
@@ -73,13 +71,25 @@ module Tomo
73
71
 
74
72
  private
75
73
 
76
- attr_reader :container_id, :image_id
74
+ attr_reader :container_id, :image_id, :private_key_path
77
75
 
78
76
  def pull_base_image_if_needed
79
77
  images = Local.capture('docker images --format "{{.ID}}" ubuntu:18.04')
80
78
  Local.capture("docker pull ubuntu:18.04") if images.strip.empty?
81
79
  end
82
80
 
81
+ def set_up_private_key
82
+ @private_key_path = File.join(
83
+ Dir.tmpdir,
84
+ "tomo_test_ed25519_#{SecureRandom.hex(8)}"
85
+ )
86
+ FileUtils.cp(
87
+ File.expand_path("tomo_test_ed25519", __dir__),
88
+ private_key_path
89
+ )
90
+ FileUtils.chmod(0o600, private_key_path)
91
+ end
92
+
83
93
  def build_image
84
94
  Local.capture(
85
95
  "docker build #{build_dir}"
data/lib/tomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "0.14.0".freeze
2
+ VERSION = "0.14.1".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.14.0
4
+ version: 0.14.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: 2019-11-28 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubygems_version: 3.0.3
333
+ rubygems_version: 3.0.6
334
334
  signing_key:
335
335
  specification_version: 4
336
336
  summary: A friendly CLI for deploying Rails apps ✨