hak 0.4.4 → 0.4.5
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/bin/hak +12 -5
- data/lib/hak/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48cd551542a1400f9ebde1941414be0e6283bb7e
|
|
4
|
+
data.tar.gz: c709691b827801faed980951a0975bffc0783f85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e313939fa766cfc6384705637139f81eb89da9b7c5e27a85f99e816092d7761b9e94e455d0a8ed762a5ec51ffe1e683a235fc40409e86af049db8e14bc08f72
|
|
7
|
+
data.tar.gz: fbe810cc810be2cbce09cd5998bd3b5250bc1686ebeec83bf69611b86647d0f6f95bad6763123d47cd321091b18352b0a1323c3c9d913d1757951668110f25e8
|
data/bin/hak
CHANGED
|
@@ -6,7 +6,7 @@ require 'yaml'
|
|
|
6
6
|
require 'colorize'
|
|
7
7
|
|
|
8
8
|
program :name, 'hak'
|
|
9
|
-
program :version, '0.4.
|
|
9
|
+
program :version, '0.4.5'
|
|
10
10
|
program :description, 'Hak - start hacking!'
|
|
11
11
|
|
|
12
12
|
default_command :help
|
|
@@ -332,24 +332,31 @@ command :deploy do |c|
|
|
|
332
332
|
end
|
|
333
333
|
|
|
334
334
|
# check if docker is installed
|
|
335
|
-
res = `ssh #{dest} which docker
|
|
335
|
+
res = `ssh #{dest} which docker`.strip
|
|
336
336
|
if res == ""
|
|
337
337
|
dest_docker_installed = false
|
|
338
338
|
end
|
|
339
339
|
|
|
340
340
|
# check if docker-compose is installed
|
|
341
|
-
res = `ssh #{dest} which docker-compose
|
|
341
|
+
res = `ssh #{dest} which docker-compose`.strip
|
|
342
342
|
if res == ""
|
|
343
343
|
dest_docker_installed = false
|
|
344
344
|
end
|
|
345
345
|
|
|
346
|
+
|
|
346
347
|
# if docker and/or docker-compose is not installed in dest server, install it
|
|
347
348
|
if dest_docker_installed == false
|
|
348
|
-
res = `ssh #{dest} curl -s https://gist.githubusercontent.com/jaequery/d61ce5371068bc4b386e80b120e8f217/raw/6f14fb1a373335606e86e76627a2debfb8737ab3/install_latest_docker_compose.sh | bash /dev/stdin`
|
|
349
|
+
res = `ssh #{dest} "curl -s https://gist.githubusercontent.com/jaequery/d61ce5371068bc4b386e80b120e8f217/raw/6f14fb1a373335606e86e76627a2debfb8737ab3/install_latest_docker_compose.sh | bash /dev/stdin"`
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# add user to docker group if not root
|
|
353
|
+
user = `ssh #{dest} whoami`.strip
|
|
354
|
+
if res != "root"
|
|
355
|
+
system "ssh #{dest} sudo usermod -aG docker #{user}"
|
|
349
356
|
end
|
|
350
357
|
|
|
351
358
|
# if jwilder/nginx-proxy is not running, run it
|
|
352
|
-
res = `ssh #{dest} docker ps |grep jwilder/nginx-proxy
|
|
359
|
+
res = `ssh #{dest} docker ps |grep jwilder/nginx-proxy`.strip
|
|
353
360
|
if res == ""
|
|
354
361
|
res = `ssh #{dest} "docker run -d --restart=always -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --name=proxy jwilder/nginx-proxy"`
|
|
355
362
|
end
|
data/lib/hak/version.rb
CHANGED