mina-rails-tools 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57bc809c36e0c5c0e575e7305821862a1a43f541
4
- data.tar.gz: 943a70c57c53406e6ab080c02fb7c96bbd01de3d
3
+ metadata.gz: 4ac646a5908cb9aca9a13adeec68e1ff94dd8cf9
4
+ data.tar.gz: 8343d35a0327c0436673d7ba55a329f2161fa469
5
5
  SHA512:
6
- metadata.gz: 1412f8f892658516babb9026f72aac6c065695272edfb5f7b26bf30c99b16f71c889b9859716e49cc42ab6e5f23ac00803d5a9e93b31f4441ea64689b443f9c9
7
- data.tar.gz: 4b2f5f6a85567f4f586330c63190338d2bb037212d45e23c6fa814703eff290b7f198e8b71dceaadc4f3f7386d9b999a055e5bd2b2a855936d555686b23b3f89
6
+ metadata.gz: 14618d267fb7db1a13e8a8d03153353d5c578ffe604e44a4837f506d9d47d4734dc66535972de87430bc43d80af8fcdd0a3d460ba8ed24ae03193e1796378d93
7
+ data.tar.gz: 15908838581d84b329c819f25704601e027c363a3fc0e7062fe084af237fd14708045961e5b3d46f80411f51ea75fae8579e115a6ae7a1d4a982d5224911cbc8
@@ -1,7 +1,7 @@
1
1
  set :apt_source, :us
2
2
 
3
3
  def apt_get(package)
4
- command echo_cmd "sudo apt-get install #{package} -y"
4
+ command "sudo apt-get install #{package} -y"
5
5
  end
6
6
 
7
7
  namespace :apt do
@@ -1,5 +1,5 @@
1
1
  def brew_install(package)
2
- command echo_cmd "sudo brew install #{package} -y"
2
+ command "sudo brew install #{package} -y"
3
3
  end
4
4
 
5
5
 
@@ -57,7 +57,7 @@ namespace :extra do
57
57
  end.uniq
58
58
 
59
59
  folders.map do |dir|
60
- command echo_cmd %{mkdir -p "#{deploy_to}/shared/#{dir}"}
60
+ command %{mkdir -p "#{deploy_to}/shared/#{dir}"}
61
61
  end
62
62
  end
63
63
 
@@ -1,5 +1,5 @@
1
1
  def gem_install(package, options=nil)
2
- command echo_cmd "sudo gem install #{package} #{options} --no-rdoc --no-ri"
2
+ command "sudo gem install #{package} #{options} --no-rdoc --no-ri"
3
3
  end
4
4
 
5
5
  namespace :gem do
@@ -11,13 +11,13 @@ namespace :gem do
11
11
  namespace :source do
12
12
  task :prepare do
13
13
  if in_china?
14
- command echo_cmd "sudo gem source -a http://ruby.taobao.org/"
15
- command echo_cmd "sudo gem source -r https://rubygems.org/"
14
+ command "sudo gem source -a http://ruby.taobao.org/"
15
+ command "sudo gem source -r https://rubygems.org/"
16
16
  end
17
17
  end
18
18
 
19
19
  task :list do
20
- command echo_cmd "sudo gem source"
20
+ command "sudo gem source"
21
21
  end
22
22
  end
23
23
 
@@ -10,44 +10,44 @@ set :use_god, true
10
10
  namespace :god do
11
11
 
12
12
  task :setup do
13
- command echo_cmd "sudo mkdir -p #{god_path}/conf"
13
+ command "sudo mkdir -p #{god_path}/conf"
14
14
  end
15
15
 
16
16
  task :link do
17
17
  extra_echo "Relocate god script file"
18
- command echo_cmd %{sudo rm -rf "#{god_service_path}/god"}
19
- command echo_cmd "sudo mkdir -p #{god_path}/conf"
20
- command echo_cmd "sudo chown -R #{user} #{god_path}"
21
- command echo_cmd %{sudo cp "#{god_path}/god.sh" "#{god_service_path}/god"}
22
- command echo_cmd %{sudo chown #{god_user}:#{god_group} "#{god_service_path}/god"}
23
- command echo_cmd %{sudo chmod +x "#{god_service_path}/god"}
24
- command echo_cmd "sudo chown -R #{god_user}:#{god_group} #{god_path}"
25
- command echo_cmd "sudo update-rc.d god defaults"
18
+ command %{sudo rm -rf "#{god_service_path}/god"}
19
+ command "sudo mkdir -p #{god_path}/conf"
20
+ command "sudo chown -R #{user} #{god_path}"
21
+ command %{sudo cp "#{god_path}/god.sh" "#{god_service_path}/god"}
22
+ command %{sudo chown #{god_user}:#{god_group} "#{god_service_path}/god"}
23
+ command %{sudo chmod +x "#{god_service_path}/god"}
24
+ command "sudo chown -R #{god_user}:#{god_group} #{god_path}"
25
+ command "sudo update-rc.d god defaults"
26
26
  end
27
27
 
28
28
  task :tmp_add_permission do
29
- command echo_cmd "sudo chown -R #{user} #{god_path}"
29
+ command "sudo chown -R #{user} #{god_path}"
30
30
  end
31
31
 
32
32
  task :set_permission do
33
- command echo_cmd "sudo chown -R #{god_user}:#{god_group} #{god_path}"
33
+ command "sudo chown -R #{god_user}:#{god_group} #{god_path}"
34
34
  end
35
35
 
36
36
  task :upload => [:'upload:script', :'upload:global']
37
37
 
38
38
  namespace :upload do
39
39
  task :script do
40
- command echo_cmd "sudo mkdir -p #{god_path}/conf"
41
- command echo_cmd "sudo chown -R #{user} #{god_path}"
40
+ command "sudo mkdir -p #{god_path}/conf"
41
+ command "sudo chown -R #{user} #{god_path}"
42
42
  upload_file "god.sh", "#{god_path}/god.sh"
43
- command echo_cmd "sudo chown -R #{god_user}:#{god_group} #{god_path}"
43
+ command "sudo chown -R #{god_user}:#{god_group} #{god_path}"
44
44
  end
45
45
 
46
46
  task :global do
47
- command echo_cmd "sudo mkdir -p #{god_path}/conf"
48
- command echo_cmd "sudo chown -R #{user} #{god_path}"
47
+ command "sudo mkdir -p #{god_path}/conf"
48
+ command "sudo chown -R #{user} #{god_path}"
49
49
  upload_file 'global.god', "#{god_path}/global.god"
50
- command echo_cmd "sudo chown -R #{god_user}:#{god_group} #{god_path}"
50
+ command "sudo chown -R #{god_user}:#{god_group} #{god_path}"
51
51
  end
52
52
  end
53
53
 
@@ -56,7 +56,7 @@ namespace :god do
56
56
  task action.to_sym do
57
57
  invoke :sudo
58
58
  command %{echo "-----> #{action.capitalize} God"}
59
- command echo_cmd "sudo #{god_service_path}/god #{action}"
59
+ command "sudo #{god_service_path}/god #{action}"
60
60
  end
61
61
  end
62
62
 
@@ -19,7 +19,7 @@ namespace :nginx do
19
19
  invoke :sudo
20
20
  extra_echo("Nginx: Symlink config file")
21
21
 
22
- command echo_cmd %{sudo ln -fs "#{deploy_to}/shared/nginx.conf" "#{nginx_conf_path}/#{fetch(:app)}.conf"}
22
+ command %{sudo ln -fs "#{deploy_to}/shared/nginx.conf" "#{nginx_conf_path}/#{fetch(:app)}.conf"}
23
23
  # command check_symlink nginx_conf_path
24
24
  end
25
25
 
@@ -38,7 +38,7 @@ namespace :nginx do
38
38
  task action.to_sym do
39
39
  invoke :sudo
40
40
  extra_echo("Nginx: #{action.capitalize}")
41
- command echo_cmd "sudo service nginx #{action}"
41
+ command "sudo service nginx #{action}"
42
42
  end
43
43
  end
44
44
  end
@@ -20,9 +20,9 @@ namespace :rainbows do
20
20
  desc "Unicron: startup"
21
21
  task :defaults do
22
22
  invoke :sudo
23
- command echo_cmd %{sudo chown root:root /etc/init.d/rainbows-#{fetch(:app)}}
24
- command echo_cmd %{sudo chmod u+x /etc/init.d/rainbows-#{fetch(:app)}}
25
- command echo_cmd "sudo update-rc.d rainbows-#{fetch(:app)} defaults"
23
+ command %{sudo chown root:root /etc/init.d/rainbows-#{fetch(:app)}}
24
+ command %{sudo chmod u+x /etc/init.d/rainbows-#{fetch(:app)}}
25
+ command "sudo update-rc.d rainbows-#{fetch(:app)} defaults"
26
26
  end
27
27
 
28
28
  task :log do
@@ -37,7 +37,7 @@ namespace :rainbows do
37
37
  task :link do
38
38
  invoke :sudo
39
39
  extra_echo("Rainbows: Link script file")
40
- command echo_cmd %{sudo cp '#{deploy_to}/shared/config/rainbows_init.sh' '/etc/init.d/rainbows-#{fetch(:app)}'}
40
+ command %{sudo cp '#{deploy_to}/shared/config/rainbows_init.sh' '/etc/init.d/rainbows-#{fetch(:app)}'}
41
41
 
42
42
  invoke :"rainbows:defaults"
43
43
  end
@@ -45,19 +45,19 @@ namespace :rainbows do
45
45
  desc "Start rainbows"
46
46
  task :start do
47
47
  extra_echo("Rainbows: Start")
48
- command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} start"
48
+ command "/etc/init.d/rainbows-#{fetch(:app)} start"
49
49
  end
50
50
 
51
51
  desc "Stop rainbows"
52
52
  task :stop do
53
53
  extra_echo("Rainbows: Stop")
54
- command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} stop"
54
+ command "/etc/init.d/rainbows-#{fetch(:app)} stop"
55
55
  end
56
56
 
57
57
  desc "Restart rainbows using 'upgrade'"
58
58
  task :restart do
59
59
  extra_echo("Rainbows: Restart")
60
- command echo_cmd "/etc/init.d/rainbows-#{fetch(:app)} upgrade"
60
+ command "/etc/init.d/rainbows-#{fetch(:app)} upgrade"
61
61
  end
62
62
 
63
63
  end
@@ -7,5 +7,5 @@ task :uptime do
7
7
  end
8
8
 
9
9
  task :gp do
10
- command echo_cmd "ps aux | grep #{ENV["p"]}"
10
+ command "ps aux | grep #{ENV["p"]}"
11
11
  end
@@ -21,7 +21,7 @@ namespace :ubuntu do
21
21
  namespace :remote do
22
22
  task :setup do
23
23
  invoke :sudo
24
- command echo_cmd %{mkdir -p ~/.ssh}
24
+ command %{mkdir -p ~/.ssh}
25
25
  append_template(ssh_pub_key_path, ".ssh/authorized_keys")
26
26
  end
27
27
 
@@ -30,31 +30,31 @@ namespace :ubuntu do
30
30
  add_user("deploy")
31
31
  command "sudo usermod -a -G www-data deploy"
32
32
 
33
- command echo_cmd "sudo mkdir -p /home/deploy/.ssh"
34
- command echo_cmd "sudo touch /home/deploy/.ssh/authorized_keys"
33
+ command "sudo mkdir -p /home/deploy/.ssh"
34
+ command "sudo touch /home/deploy/.ssh/authorized_keys"
35
35
  append_template(ssh_pub_key_path, "/home/deploy/.ssh/authorized_keys")
36
- command echo_cmd "sudo chown -R deploy:deploy /home/deploy/.ssh"
37
- command echo_cmd "sudo chmod 664 /home/deploy/.ssh/authorized_keys"
36
+ command "sudo chown -R deploy:deploy /home/deploy/.ssh"
37
+ command "sudo chmod 664 /home/deploy/.ssh/authorized_keys"
38
38
  end
39
39
 
40
40
  task :add_ubuntu do
41
41
  invoke :sudo
42
42
  add_user("ubuntu")
43
- command echo_cmd "sudo groupadd admin"
44
- command echo_cmd "sudo usermod -a -G admin ubuntu"
45
- command echo_cmd "sudo mkdir -p /home/ubuntu/.ssh"
46
- command echo_cmd "sudo touch /home/ubuntu/.ssh/authorized_keys"
43
+ command "sudo groupadd admin"
44
+ command "sudo usermod -a -G admin ubuntu"
45
+ command "sudo mkdir -p /home/ubuntu/.ssh"
46
+ command "sudo touch /home/ubuntu/.ssh/authorized_keys"
47
47
  append_template(ssh_pub_key_path, "/home/ubuntu/.ssh/authorized_keys")
48
- command echo_cmd "sudo chown -R ubuntu:ubuntu /home/ubuntu/.ssh"
49
- command echo_cmd "sudo chmod 664 /home/ubuntu/.ssh/authorized_keys"
48
+ command "sudo chown -R ubuntu:ubuntu /home/ubuntu/.ssh"
49
+ command "sudo chmod 664 /home/ubuntu/.ssh/authorized_keys"
50
50
  end
51
51
  end
52
52
 
53
53
  namespace :locale do
54
54
  task :setup do
55
55
  invoke :sudo
56
- command echo_cmd %{sudo locale-gen en_US en_US.UTF8}
57
- command echo_cmd %{sudo sh -c "echo 'LC_ALL=\"en_US.utf8\"' >> /etc/environment"}
56
+ command %{sudo locale-gen en_US en_US.UTF8}
57
+ command %{sudo sh -c "echo 'LC_ALL=\"en_US.utf8\"' >> /etc/environment"}
58
58
  end
59
59
  end
60
60
 
@@ -92,8 +92,8 @@ namespace :ubuntu do
92
92
 
93
93
  task :www do
94
94
  invoke :sudo
95
- command echo_cmd "sudo mkdir -p /var/www"
96
- command echo_cmd "sudo chown -R deploy:www-data /var/www"
95
+ command "sudo mkdir -p /var/www"
96
+ command "sudo chown -R deploy:www-data /var/www"
97
97
  end
98
98
 
99
99
  task :ssh_key do
@@ -22,7 +22,7 @@ namespace :unicorn do
22
22
  desc "Unicron: startup"
23
23
  task :defaults do
24
24
  invoke :sudo
25
- command echo_cmd "sudo update-rc.d unicorn-#{fetch(:app)} defaults"
25
+ command "sudo update-rc.d unicorn-#{fetch(:app)} defaults"
26
26
  end
27
27
 
28
28
  namespace :god do
@@ -32,18 +32,18 @@ namespace :unicorn do
32
32
 
33
33
  task :link do
34
34
  invoke :sudo
35
- command echo_cmd %{sudo cp -rf #{deploy_to}/#{shared_path}/unicorn.god #{god_path}/conf/unicorn-#{fetch(:app)}.god}
35
+ command %{sudo cp -rf #{deploy_to}/#{shared_path}/unicorn.god #{god_path}/conf/unicorn-#{fetch(:app)}.god}
36
36
  invoke :"god:restart"
37
37
  end
38
38
 
39
39
  task :start do
40
40
  invoke :sudo
41
- command echo_cmd %{sudo god start unicorn_#{fetch(:app)}}
41
+ command %{sudo god start unicorn_#{fetch(:app)}}
42
42
  end
43
43
 
44
44
  task :stop do
45
45
  invoke :sudo
46
- command echo_cmd %{sudo god stop unicorn_#{fetch(:app)}}
46
+ command %{sudo god stop unicorn_#{fetch(:app)}}
47
47
  end
48
48
  end
49
49
 
@@ -59,28 +59,28 @@ namespace :unicorn do
59
59
  task :link do
60
60
  invoke :sudo
61
61
  extra_echo("Unicorn: Link script file")
62
- command echo_cmd %{sudo cp '#{deploy_to}/shared/unicorn_init.sh' '/etc/init.d/unicorn-#{fetch(:app)}'}
63
- command echo_cmd %{sudo chown #{user!}:#{group!} /etc/init.d/unicorn-#{fetch(:app)}}
64
- command echo_cmd %{sudo chmod u+x /etc/init.d/unicorn-#{fetch(:app)}}
62
+ command %{sudo cp '#{deploy_to}/shared/unicorn_init.sh' '/etc/init.d/unicorn-#{fetch(:app)}'}
63
+ command %{sudo chown #{user!}:#{group!} /etc/init.d/unicorn-#{fetch(:app)}}
64
+ command %{sudo chmod u+x /etc/init.d/unicorn-#{fetch(:app)}}
65
65
  # invoke :"unicorn:defaults"
66
66
  end
67
67
 
68
68
  desc "Start unicorn"
69
69
  task :start do
70
70
  extra_echo("Unicorn: Start")
71
- command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} start"
71
+ command "/etc/init.d/unicorn-#{fetch(:app)} start"
72
72
  end
73
73
 
74
74
  desc "Stop unicorn"
75
75
  task :stop do
76
76
  extra_echo("Unicorn: Stop")
77
- command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} stop"
77
+ command "/etc/init.d/unicorn-#{fetch(:app)} stop"
78
78
  end
79
79
 
80
80
  desc "Restart unicorn using 'upgrade'"
81
81
  task :restart do
82
82
  extra_echo("Unicorn: Restart")
83
- command echo_cmd "/etc/init.d/unicorn-#{fetch(:app)} upgrade"
83
+ command "/etc/init.d/unicorn-#{fetch(:app)} upgrade"
84
84
  end
85
85
 
86
86
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Extras
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-rails-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Lin