pgbackups_s3 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c319d7e73ee0cbd5e4fe2cf6bc7622d3b2d1d7f4
4
- data.tar.gz: e1b293fde436f534da3259428fb2256df7a106ae
3
+ metadata.gz: 00f0176066e7495a7357c6f77301bf61c418f260
4
+ data.tar.gz: ad92b069dadfdafa482124f6c221170a646e7f75
5
5
  SHA512:
6
- metadata.gz: 1e9a3d682dcba23caa5b6088d63aac054b408a4d9a150f3b7633550972fe1639575eea025842cdb6f959b98461df40fe0327dbbea059bc2ce012b121b4abe8db
7
- data.tar.gz: 52d14d88344fee1d8889e0b69fa2e5f78531c03ba49f6e60af8dfc5b07169f2ee8c521dc7fb5dfed6dec4f8b4b5c9ecc722cb0b2ff071159a8ce3cd89dca3ddb
6
+ metadata.gz: bfb7a1611706d3bc580e8656dda72b3e77bcb0611b703e423f600cfce128beac9ce643ab1b11966598b3e83c5ec7fae643e5c8f3b72e3ca4efdfaa67dd4ce679
7
+ data.tar.gz: 6f9647f53f6451156e40e401095f60e03cae49ddd9cc07a678ac06cf886ec724332309c736051dcd96efffc7884ed0f17025ec0fb6aa161cd920f517c7713424
data/README.md CHANGED
@@ -8,7 +8,7 @@ allows you restore your current database from any of the backups on S3.
8
8
 
9
9
  To install on your system
10
10
 
11
- `gem install pgbackups`
11
+ `gem install pgbackups_s3`
12
12
 
13
13
  To install in rails app, add the following line to your Gemfile
14
14
 
@@ -22,6 +22,12 @@ Then create the initialzer that will hold all the settings for the packups
22
22
 
23
23
  Go to `config/initializers/pgbackups_s3.rb` and follow the documentation to get your backups cranking!
24
24
 
25
+ After the initializer is all setup, run:
26
+
27
+ `rake pgbackups_s3:setup`
28
+
29
+ if you need to create the bucket on S3
30
+
25
31
  ## Using the gem
26
32
 
27
33
  ### Back dat database up
@@ -80,4 +86,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
80
86
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81
87
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
82
88
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
83
- THE SOFTWARE.
89
+ THE SOFTWARE.
@@ -1,6 +1,10 @@
1
1
  class PgbackupsS3
2
2
  include HTTParty
3
3
 
4
+ def self.setup
5
+ p = new
6
+ p.create_bucket
7
+ end
4
8
 
5
9
  def self.backup
6
10
  p = new
@@ -43,6 +47,11 @@ class PgbackupsS3
43
47
  )
44
48
  end
45
49
 
50
+ def create_bucket
51
+ bucket = @s3.buckets.create(@bucket)
52
+ bucket.acl = :private
53
+ end
54
+
46
55
  def get_latest_backup
47
56
  @backup_url = self.class.get("#{@host}/client/latest_backup")['public_url']
48
57
  end
@@ -1,4 +1,7 @@
1
1
  namespace :pgbackups_s3 do
2
+ task :setup => :environment do
3
+ PgbackupsS3.setup
4
+ end
2
5
  task :backup => :environment do
3
6
  PgbackupsS3.backup
4
7
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pgbackups_s3'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
4
4
  s.date = '2014-07-25'
5
5
  s.summary = %w{Send pgbackups to S3 using aws_sdk}
6
6
  s.description = %w{Send pgbackups to S3 using aws_sdk. This gem also allows
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbackups_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Leonard