josh-slicehost 0.0.2 → 0.0.2.1

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.
data/README CHANGED
@@ -1,15 +1,13 @@
1
1
  Slicehost Recipes
2
2
  =================
3
3
 
4
- Slicehost Capistrano recipes for configuring and managing your slice.
5
-
4
+ Slicehost Capistrano recipes for configuring and managing your slice. Require Capistrano >2.5.0
6
5
 
7
6
  Example
8
7
  =======
9
8
 
10
9
  The recipes are designed to work stand alone apart from the standard set of Capistrano deploy recipes.
11
10
 
12
- cap -f slicehost.rb
13
-
11
+ require 'capistrano/ext/slicehost' in your deploy.rb file
14
12
 
15
- Copyright (c) 2007 Joshua Peek, released under the MIT license
13
+ Copyright (c) 2008 Joshua Peek, updated by Oleg Zhurbiy, released under the MIT license
@@ -8,6 +8,11 @@ namespace :gems do
8
8
  task :update, :roles => :app do
9
9
  sudo "gem update"
10
10
  end
11
+
12
+ desc "Update gem system on remote server"
13
+ task :update_system, :roles => :app do
14
+ sudo "gem update --system"
15
+ end
11
16
 
12
17
  desc "Install a gem on the remote server"
13
18
  task :install, :roles => :app do
@@ -1,6 +1,36 @@
1
1
  namespace :mysql do
2
+ desc "Restarts MySQL database server"
3
+ task :restart, :roles => :db do
4
+ sudo "/etc/init.d/mysql restart"
5
+ end
6
+
7
+ desc "Starts MySQL database server"
8
+ task :start, :roles => :db do
9
+ sudo "/etc/init.d/mysql start"
10
+ end
11
+
12
+ desc "Stops MySQL database server"
13
+ task :stop, :roles => :db do
14
+ sudo "/etc/init.d/mysql stop"
15
+ end
16
+
17
+ desc "Export MySQL database"
18
+ task :export, :roles => :db do
19
+ database = Capistrano::CLI.ui.ask("Which database should we export: ")
20
+ sudo "mysqldump -u root -p #{database} > #{database}.sql"
21
+ end
22
+
23
+ desc "Import MySQL database"
24
+ task :import, :roles => :db do
25
+ database = Capistrano::CLI.ui.ask("Which database should we create: ")
26
+ file = Capistrano::CLI.ui.ask("Which database file should we import: ")
27
+ sudo "mysqladmin -u root -p create #{database}"
28
+ sudo "mysql -u root -p #{database} < #{file}"
29
+ end
30
+
2
31
  desc "Install MySQL"
3
32
  task :install, :roles => :db do
4
- sudo "sudo aptitude install -y mysql-server mysql-client libmysqlclient15-dev libmysql-ruby1.8"
33
+ sudo "aptitude install -y mysql-server mysql-client libmysqlclient15-dev"
34
+ sudo "aptitude install -y libmysql-ruby1.8"
5
35
  end
6
36
  end
@@ -1 +1,7 @@
1
- Dir["#{File.dirname(__FILE__)}/slicehost/*.rb"].each { |lib| load(lib) }
1
+ unless Capistrano::Configuration.respond_to?(:instance)
2
+ abort "Requires Capistrano 2"
3
+ end
4
+
5
+ Dir["#{File.dirname(__FILE__)}/slicehost/*.rb"].each { |lib|
6
+ Capistrano::Configuration.instance.load {load(lib)}
7
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: josh-slicehost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek