hamal 0.1.1 → 0.2
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 +4 -4
- data/README.md +4 -4
- data/Rakefile +0 -2
- data/lib/hamal.rb +15 -4
- 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: f9ef115de2f093d85ef84dbc3fcc3018ced655c0a8a71311ba3cbbbabeb2195f
|
|
4
|
+
data.tar.gz: 65a1477d5ff0827ea4c93bced1f08590b29d806e3497b71898437baa92e446a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1a7250bd24d6c87653f3ecb1e725e52a6e342fc9bd0fedf8621ef61c29d5b8b260ea5e0b687458a5f975b56a9680e6131c79cf34e7194f85829943d3effa69f
|
|
7
|
+
data.tar.gz: 6c382bd0bf2e8e4d5817e1ba3f6b940a5fc83d8d999d389ee26e9568ddb76b35803b985dfc1cf1d6aec39e12f86882540c1e9f54f90bfa59b2d7341186514759
|
data/README.md
CHANGED
|
@@ -252,13 +252,13 @@ Make sure its owner user and group are `rails:rails`.
|
|
|
252
252
|
|
|
253
253
|
If this is a new app, create its database by running `bin/rails db:create` in
|
|
254
254
|
out of its images. You will likely have to do this at a later point, when you
|
|
255
|
-
do have such an image. Examine `
|
|
255
|
+
do have such an image. Examine `hamal` to determine what arguments to
|
|
256
256
|
`docker run` are needed, e.g. to set ENV variables and mount host directories.
|
|
257
257
|
The final commands you're looking for will look something like this:
|
|
258
258
|
|
|
259
259
|
```
|
|
260
|
-
docker run --rm <args inferred from
|
|
261
|
-
docker run --rm <args inferred from
|
|
260
|
+
docker run --rm <args inferred from hamal> --entrypoint '/rails/bin/rails' <app_image> -- db:create
|
|
261
|
+
docker run --rm <args inferred from hamal> --entrypoint '/rails/bin/rails' <app_image> -- db:schema:load
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
## GitHub
|
|
@@ -334,7 +334,7 @@ local commits.
|
|
|
334
334
|
For more commands, run `hamal --help`:
|
|
335
335
|
|
|
336
336
|
```
|
|
337
|
-
Usage:
|
|
337
|
+
Usage: hamal [command]
|
|
338
338
|
|
|
339
339
|
Commands:
|
|
340
340
|
deploy - Deploy the app to the server
|
data/Rakefile
CHANGED
data/lib/hamal.rb
CHANGED
|
@@ -3,7 +3,7 @@ require "json"
|
|
|
3
3
|
require "yaml"
|
|
4
4
|
|
|
5
5
|
module Hamal
|
|
6
|
-
VERSION = "0.
|
|
6
|
+
VERSION = "0.2"
|
|
7
7
|
|
|
8
8
|
module Config
|
|
9
9
|
def config_file = "config/deploy.yml"
|
|
@@ -209,7 +209,9 @@ module Hamal
|
|
|
209
209
|
console_command
|
|
210
210
|
when "logs"
|
|
211
211
|
logs_command
|
|
212
|
-
when "
|
|
212
|
+
when "dump"
|
|
213
|
+
dump_command
|
|
214
|
+
when "ssh", "sudo"
|
|
213
215
|
sudo_command
|
|
214
216
|
else
|
|
215
217
|
help_command
|
|
@@ -261,6 +263,14 @@ module Hamal
|
|
|
261
263
|
end
|
|
262
264
|
end
|
|
263
265
|
|
|
266
|
+
def dump_command
|
|
267
|
+
log "Dumping database"
|
|
268
|
+
|
|
269
|
+
on_server do
|
|
270
|
+
system "scp -O root@#{server}:/var/lib/#{app_name}/db/data.sqlite3 data.sqlite3", exception: true
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
264
274
|
def sudo_command
|
|
265
275
|
system "ssh root@#{server}", exception: true
|
|
266
276
|
end
|
|
@@ -271,9 +281,10 @@ module Hamal
|
|
|
271
281
|
|
|
272
282
|
Commands:
|
|
273
283
|
deploy - Deploy the app to the server
|
|
274
|
-
console - Run
|
|
284
|
+
console - Run rails console in the deployed container
|
|
285
|
+
backup - Backup the SQLite database from the server
|
|
275
286
|
logs - Follow logs of the deployed container
|
|
276
|
-
|
|
287
|
+
ssh - SSH into the server as administrator, alias: sudo
|
|
277
288
|
HELP
|
|
278
289
|
end
|
|
279
290
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hamal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.2'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Genadi Samokovarov
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: json
|
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
56
56
|
- !ruby/object:Gem::Version
|
|
57
57
|
version: '0'
|
|
58
58
|
requirements: []
|
|
59
|
-
rubygems_version: 3.6.
|
|
59
|
+
rubygems_version: 3.6.9
|
|
60
60
|
specification_version: 4
|
|
61
61
|
summary: Hamal is a simple deploy tool for self-hosted Rails applications
|
|
62
62
|
test_files: []
|