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 +4 -4
- data/README.md +20 -0
- data/lib/tomo/testing/docker_image.rb +15 -5
- data/lib/tomo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cbbf974be9564d4c3a62f37c35168b6bb843d7795713747a4ed61e8900e1dfc
|
4
|
+
data.tar.gz: 0c9d63948b5685c078e7e29516361aedb92bca506f8d288dd2dcb6b7167c9f4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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=#{
|
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
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.
|
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
|
+
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.
|
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 ✨
|