appli 0.0.9 → 0.0.10

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 (3) hide show
  1. data/lib/appli.rb +1 -1
  2. data/lib/commands/db.rb +12 -0
  3. metadata +1 -1
data/lib/appli.rb CHANGED
@@ -14,7 +14,7 @@ module Appli
14
14
  class NotConfiguredError < StandardError; end
15
15
  class MustBeInRepositoryError < StandardError; end
16
16
 
17
- VERSION = "0.0.9"
17
+ VERSION = "0.0.10"
18
18
 
19
19
  def run(command, args = [])
20
20
  load_commands
data/lib/commands/db.rb CHANGED
@@ -68,3 +68,15 @@ command "db:create", :required_args => 1 do |*label|
68
68
  display_errors
69
69
  end
70
70
  end
71
+
72
+ desc 'Dump the database schema'
73
+ usage "appli [application] db:export {db number} {file}"
74
+ command "db:export", :required_args => 2 do |number, file|
75
+ if database = get("applications/#{@options[:application]}/databases/#{number}")['database']
76
+ dump = remote_exec("mysqldump -u #{database['username']} -p#{database['password']} -h #{database['host']['name']} #{database['name']}")
77
+ File.open(file, 'w') {|f| f.write(dump) }
78
+ puts "MySQL dump written to '#{file}'. It was #{dump.size} bytes"
79
+ else
80
+ error "Database not found with #{number}. Check 'appli [application] db:list'"
81
+ end
82
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke