hak 0.5.0 → 0.5.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/bin/hak +29 -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: 59036d5baab90eccfda9560822c1344bcd5bcd89
|
|
4
|
+
data.tar.gz: 18b22fa73884b8713ce8c543a642a0090af4e5d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 512494f63e62bd716e6228896204663f05a0cef309106a5589d19475016fb0be48f0f353fb78c077f86b75e579af9f98241aeefdd1e06331080853296135d612
|
|
7
|
+
data.tar.gz: cc6cd146a93e1154e2d07bd1b0e9461db18c2173dad577fbe871d352757cf04a1e04f5061d758599b0ebfa1e61000b11064914cd3633f5a6554287cd8da3afb8
|
data/bin/hak
CHANGED
|
@@ -7,7 +7,7 @@ require 'colorize'
|
|
|
7
7
|
require 'highline'
|
|
8
8
|
|
|
9
9
|
program :name, 'hak'
|
|
10
|
-
program :version, '0.5.
|
|
10
|
+
program :version, '0.5.2'
|
|
11
11
|
program :description, 'Hak - A Docker powered website manager for OSX'
|
|
12
12
|
|
|
13
13
|
default_command :help
|
|
@@ -139,12 +139,12 @@ command :get do |c|
|
|
|
139
139
|
c.action do |args, options|
|
|
140
140
|
|
|
141
141
|
if args.empty?
|
|
142
|
-
puts "
|
|
142
|
+
puts "for more hak-ready packages, check out https://hak.sh/".yellow
|
|
143
|
+
puts "type one of the following to get started: ".yellow
|
|
143
144
|
puts "hak get jaequery/react-starter"
|
|
144
145
|
puts "hak get jaequery/honeybadger"
|
|
145
146
|
puts " "
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
else
|
|
149
149
|
repo = args[0]
|
|
150
150
|
folder = args[1]
|
|
@@ -187,6 +187,7 @@ command :start do |c|
|
|
|
187
187
|
c.description = 'this starts up the website'
|
|
188
188
|
c.example 'description', 'hak start'
|
|
189
189
|
c.action do |args, options|
|
|
190
|
+
check_docker
|
|
190
191
|
run "docker-compose up -d && docker-compose logs -f"
|
|
191
192
|
end
|
|
192
193
|
end
|
|
@@ -197,6 +198,7 @@ command :stop do |c|
|
|
|
197
198
|
c.description = 'stops the site'
|
|
198
199
|
c.example 'description', 'hak stop'
|
|
199
200
|
c.action do |args, options|
|
|
201
|
+
check_docker
|
|
200
202
|
run "docker-compose stop"
|
|
201
203
|
end
|
|
202
204
|
end
|
|
@@ -207,6 +209,7 @@ command :restart do |c|
|
|
|
207
209
|
c.description = 'restarts the site'
|
|
208
210
|
c.example 'description', 'hak restart'
|
|
209
211
|
c.action do |args, options|
|
|
212
|
+
check_docker
|
|
210
213
|
run "docker-compose stop"
|
|
211
214
|
run "docker-compose up -d && docker-compose logs -f"
|
|
212
215
|
end
|
|
@@ -218,7 +221,8 @@ command :rm do |c|
|
|
|
218
221
|
c.description = 'deletes docker containers for the project'
|
|
219
222
|
c.example 'description', 'hak rm'
|
|
220
223
|
c.action do |args, options|
|
|
221
|
-
|
|
224
|
+
check_docker
|
|
225
|
+
run "docker-compose stop && docker-compose rm -f --all"
|
|
222
226
|
end
|
|
223
227
|
end
|
|
224
228
|
|
|
@@ -228,6 +232,7 @@ command :logs do |c|
|
|
|
228
232
|
c.description = ''
|
|
229
233
|
c.example 'description', 'hak logs'
|
|
230
234
|
c.action do |args, options|
|
|
235
|
+
check_docker
|
|
231
236
|
run "docker-compose logs -f"
|
|
232
237
|
end
|
|
233
238
|
end
|
|
@@ -239,6 +244,7 @@ command :ssh do |c|
|
|
|
239
244
|
c.description = ''
|
|
240
245
|
c.example 'description', 'hak ssh [app]'
|
|
241
246
|
c.action do |args, options|
|
|
247
|
+
check_docker
|
|
242
248
|
|
|
243
249
|
file_name = 'docker-compose.yml'
|
|
244
250
|
config_options = YAML.load_file(file_name)
|
|
@@ -267,6 +273,8 @@ command :ps do |c|
|
|
|
267
273
|
c.description = ''
|
|
268
274
|
c.example 'description', 'hak ps'
|
|
269
275
|
c.action do |args, options|
|
|
276
|
+
check_docker
|
|
277
|
+
|
|
270
278
|
container_names = run('docker ps --format "{{.Names}}"', true)
|
|
271
279
|
lines = container_names.lines
|
|
272
280
|
dinghy_running = false
|
|
@@ -397,3 +405,19 @@ def run(command, hide=false)
|
|
|
397
405
|
|
|
398
406
|
return res
|
|
399
407
|
end
|
|
408
|
+
|
|
409
|
+
def check_docker
|
|
410
|
+
|
|
411
|
+
res = `dinghy status`
|
|
412
|
+
if res.include? "VM: stopped"
|
|
413
|
+
running = false
|
|
414
|
+
puts "docker not running or stopped".yellow
|
|
415
|
+
puts "type this to power it on:".yellow
|
|
416
|
+
puts "hak on"
|
|
417
|
+
abort
|
|
418
|
+
else
|
|
419
|
+
running = true
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
return running
|
|
423
|
+
end
|
data/lib/hak/version.rb
CHANGED