hak 0.4.5 → 0.4.6

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hak +25 -61
  3. data/lib/hak/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48cd551542a1400f9ebde1941414be0e6283bb7e
4
- data.tar.gz: c709691b827801faed980951a0975bffc0783f85
3
+ metadata.gz: b5e03b8fac8a7dc7173b76565832a8385f9dfa4a
4
+ data.tar.gz: 751d57a03fdaf2b9163b8cca376a8c041d444e23
5
5
  SHA512:
6
- metadata.gz: 1e313939fa766cfc6384705637139f81eb89da9b7c5e27a85f99e816092d7761b9e94e455d0a8ed762a5ec51ffe1e683a235fc40409e86af049db8e14bc08f72
7
- data.tar.gz: fbe810cc810be2cbce09cd5998bd3b5250bc1686ebeec83bf69611b86647d0f6f95bad6763123d47cd321091b18352b0a1323c3c9d913d1757951668110f25e8
6
+ metadata.gz: 53e6b6b57495642c2087f5db226c345903f2893d1e1f2545d42461cc0a296bbbc8d7eb2a200463b197c1a74a94c9fed8a6048e4eee6620fbf48d6cb03290243a
7
+ data.tar.gz: a5a502b0d1714cc9917a8d76535f3752fb29b08b28fd9387f91931eca58348db998eae8d60394c56589f5d145ab91d163d611cc7e8e6ebc14347a5eb4a49b0cd
data/bin/hak CHANGED
@@ -6,16 +6,16 @@ require 'yaml'
6
6
  require 'colorize'
7
7
 
8
8
  program :name, 'hak'
9
- program :version, '0.4.5'
10
- program :description, 'Hak - start hacking!'
9
+ program :version, '0.4.6'
10
+ program :description, 'Hak - A Docker powered website manager for OSX'
11
11
 
12
12
  default_command :help
13
13
 
14
- command :setup do |c|
15
- c.syntax = 'hak setup'
16
- c.summary = 'sets up the hak environment'
14
+ command :install do |c|
15
+ c.syntax = 'hak install'
16
+ c.summary = 'installs the hak environment'
17
17
  c.description = 'installs docker and sets up the entire docker based environment along with proxy'
18
- c.example 'description', 'hak setup'
18
+ c.example 'description', 'hak install'
19
19
  c.action do |args, options|
20
20
 
21
21
  # if ~/.hak not exists, initialize it
@@ -34,20 +34,10 @@ command :setup do |c|
34
34
  system "brew install docker docker-machine docker-compose wget"
35
35
  system "brew install docker-machine-driver-xhyve"
36
36
  system "brew link --overwrite docker-machine"
37
-
38
37
  system "sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve"
39
38
  system "sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve"
40
39
  system "dinghy create --provider xhyve"
41
40
 
42
- else
43
- puts "- it exists, skipping".blue
44
- end
45
-
46
- # if ~/.dinghy not exists, initialize it
47
- puts "checking to see if ~/.dinghy exists".blue
48
- if !Dir.exists?(File.expand_path('~/.dinghy'))
49
-
50
-
51
41
  else
52
42
  puts "- it exists, skipping".blue
53
43
  end
@@ -62,7 +52,7 @@ command :setup do |c|
62
52
  docker_env_exist = `fgrep "export DOCKER_MACHINE_NAME=dinghy" ~/.zshrc |wc -l`.to_i
63
53
  if docker_env_exist == 0
64
54
  puts '- not set, type:'.yellow
65
- puts ' echo "$(dinghy env)" >> ~/.zshrc'
55
+ puts "echo 'eval $(dinghy env)' >> ~/.zshrc"
66
56
  end
67
57
  end
68
58
 
@@ -70,7 +60,7 @@ command :setup do |c|
70
60
  docker_env_exist = `fgrep "export DOCKER_MACHINE_NAME=dinghy" ~/.bash_profile |wc -l`.to_i
71
61
  if docker_env_exist == 0
72
62
  puts '- not set, type:'.yellow
73
- puts ' echo "$(dinghy env)" >> ~/.bash_profile'
63
+ puts "echo 'eval $(dinghy env)' >> ~/.bash_profile"
74
64
  end
75
65
  end
76
66
 
@@ -80,6 +70,19 @@ command :setup do |c|
80
70
  end
81
71
  end
82
72
 
73
+ command :uninstall do |c|
74
+ c.syntax = 'hak destroy'
75
+ c.summary = 'destroys hak server'
76
+ c.description = 'shuts off and destroys the hak server'
77
+ c.example 'description', 'hak destroy'
78
+ c.action do |args, options|
79
+ system "dinghy halt"
80
+ system "dinghy destroy"
81
+ system "rm -rf ~/.hak"
82
+ system "rm -rf ~/.dinghy"
83
+ end
84
+ end
85
+
83
86
  command :on do |c|
84
87
  c.syntax = 'hak on'
85
88
  c.summary = 'powers on the hak server'
@@ -101,45 +104,6 @@ command :off do |c|
101
104
  end
102
105
  end
103
106
 
104
- command :uninstall do |c|
105
- c.syntax = 'hak destroy'
106
- c.summary = 'destroys hak server'
107
- c.description = 'shuts off and destroys the hak server'
108
- c.example 'description', 'hak destroy'
109
- c.action do |args, options|
110
- system "dinghy halt"
111
- system "dinghy destroy"
112
- system "rm -rf ~/.hak"
113
- system "rm -rf ~/.dinghy"
114
- end
115
- end
116
-
117
- command :pull do |c|
118
- c.syntax = 'hak pull jaequery/honeybadger'
119
- c.summary = 'downloads framework'
120
- c.description = ''
121
- c.example 'description', 'hak pull jaequery/honeybadger'
122
- c.action do |args, options|
123
-
124
- if !Dir.exists?(File.expand_path("~/.hak"))
125
- system "mkdir ~/.hak"
126
- end
127
-
128
- if args.empty?
129
- repo = "jaequery/honeybadger"
130
- package_author = "jaequery"
131
- package = "honeybadger"
132
- puts "Pulling #{repo}"
133
- else
134
- repo = args[0]
135
- package_author = repo.split("/")[0]
136
- package = repo.split("/")[1]
137
- end
138
-
139
- system "cd ~/.hak && rm -rf #{repo} && mkdir -p #{repo} && cd #{repo} && wget https://github.com/#{repo}/archive/master.zip && unzip master.zip && rm -f master.zip && mv #{package}-master/* . && rm -r #{package}-master"
140
- end
141
- end
142
-
143
107
  command :create do |c|
144
108
  c.syntax = 'hak create something.com'
145
109
  c.summary = 'creates site'
@@ -364,13 +328,13 @@ command :deploy do |c|
364
328
  # deploy to dest
365
329
  #res = `rsync -avzr ../#{app} #{dest}:~/sites/`
366
330
  #res = `ssh #{dest} \"cd ~/sites/#{app} && docker-compose stop && docker-compose up && docker-compose logs -f\"`
367
- puts "rsyncing files ... ".yellow
331
+ puts "rsyncing from ../#{app} to #{dest}:~/sites/ ... ".yellow
368
332
  res = `rsync -avzr ../#{app} #{dest}:~/sites/`
369
- puts "files rsynced".green
333
+ puts "rsync done".green
370
334
 
371
335
  puts "running docker-compose -f docker-compose-production.yml up".yellow
372
336
  res = `ssh #{dest} "cd ~/sites/#{app} && docker-compose stop && docker-compose -f docker-compose-production.yml up && docker-compose logs"`
373
- puts "all up".green
337
+ puts "all up and running!".green
374
338
 
375
339
  end
376
340
 
@@ -379,7 +343,7 @@ end
379
343
 
380
344
 
381
345
  def run(command, hide=false)
382
- exec = "eval $(dinghy env) && #{command}"
346
+ exec = "#{command}"
383
347
 
384
348
  if hide
385
349
  res = `#{exec}`
data/lib/hak/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hak
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jaequery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-10 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander