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.
- checksums.yaml +4 -4
- data/bin/hak +25 -61
- data/lib/hak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5e03b8fac8a7dc7173b76565832a8385f9dfa4a
|
|
4
|
+
data.tar.gz: 751d57a03fdaf2b9163b8cca376a8c041d444e23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
10
|
-
program :description, 'Hak -
|
|
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 :
|
|
15
|
-
c.syntax = 'hak
|
|
16
|
-
c.summary = '
|
|
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
|
|
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
|
|
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
|
|
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
|
|
331
|
+
puts "rsyncing from ../#{app} to #{dest}:~/sites/ ... ".yellow
|
|
368
332
|
res = `rsync -avzr ../#{app} #{dest}:~/sites/`
|
|
369
|
-
puts "
|
|
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 = "
|
|
346
|
+
exec = "#{command}"
|
|
383
347
|
|
|
384
348
|
if hide
|
|
385
349
|
res = `#{exec}`
|
data/lib/hak/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: commander
|