executive 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # Boss
1
+ # Executive
2
2
 
3
- TODO: Write a gem description
3
+ Executive is a set of developer tasks for managing your development environment in a congruent way to how you manage your production application on Heroku.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'boss'
9
+ gem 'executive'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,16 +14,18 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install boss
17
+ $ gem install executive
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Deploy production
22
22
 
23
- ## Contributing
23
+ $ executive deploy production
24
+
25
+ Start your development application
24
26
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
27
+ $ executive start
28
+
29
+ Deploy to your running development application
30
+
31
+ $ executive deploy development
data/bin/executive CHANGED
@@ -16,6 +16,8 @@ when "start"
16
16
  end
17
17
  when "deploy"
18
18
  Executive.deploy ARGV[1]
19
+ when "bootstrap"
20
+ Executive.bootstrap_data
19
21
  else
20
22
  puts "Usage: executive <command> <args>"
21
23
  end
data/executive.gemspec CHANGED
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_runtime_dependency "colorize"
19
19
  gem.add_runtime_dependency "foreman"
20
+ gem.add_runtime_dependency "heroku"
20
21
  end
@@ -1,3 +1,3 @@
1
1
  module Executive
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/executive.rb CHANGED
@@ -20,6 +20,22 @@ module Executive
20
20
  Production.deploy
21
21
  end
22
22
  end
23
+
24
+ def bootstrap_data
25
+ config = YAML.load_file(File.join("config", "database.yml"))["development"]
26
+
27
+ old_backup = `heroku pgbackups | grep HEROKU_POSTGRESQL_RED | cut -d "|" -f 1 | head -n 1`
28
+ puts "Destroying Old Backup: #{old_backup}".green
29
+ `heroku pgbackups:destroy #{old_backup}`
30
+ puts "Capturing New Backup...".green
31
+ `heroku pgbackups:capture`
32
+
33
+ backup_url = `heroku pgbackups:url`.strip
34
+ `curl "#{backup_url}" > temporary_backup.dump`
35
+ puts "Restoring Backup to #{config["database"]}".green
36
+ `pg_restore --verbose --clean --no-acl --no-owner -h #{config["host"]} -U #{config["username"]} -d #{config["database"]} temporary_backup.dump`
37
+ `rm temporary_backup.dump`
38
+ end
23
39
  end
24
40
 
25
41
  module Development
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: executive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-13 00:00:00.000000000Z
12
+ date: 2012-10-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
16
- requirement: &70149864895760 !ruby/object:Gem::Requirement
16
+ requirement: &70143489915100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70149864895760
24
+ version_requirements: *70143489915100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: foreman
27
- requirement: &70149864894880 !ruby/object:Gem::Requirement
27
+ requirement: &70143489912940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,18 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70149864894880
35
+ version_requirements: *70143489912940
36
+ - !ruby/object:Gem::Dependency
37
+ name: heroku
38
+ requirement: &70143489911520 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70143489911520
36
47
  description: a Foreman wrapper with extra utilities.
37
48
  email:
38
49
  - roshan.choxi@gmail.com