nxt_heroku_database_backup 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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 595af96eb6b889cece6066f8d336db654bfd3979ac9e362df00d8de5f6e827e7
|
4
|
+
data.tar.gz: 26b4d8a215d9bc6a001d26e5e447e6b73b4d29e55615b7a8a91f57ffdf761ef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c60d83688c3d8c180e7413b023ca5fb56817923909e97cae80ca2ba2e9c920c598f41322f3d65e6c261915442efae061c4b3e0b247217164550ebd8f07473baa
|
7
|
+
data.tar.gz: 174aabb498e7d50cccf8720bd85cfd90165f0beaa313b2c9540f0b15c598632a738ee0c7c0925a9081ed547fa75d8f79fdcaa0ce0da1d70e1de498a67def7cd2
|
@@ -12,7 +12,7 @@ module NxtHerokuDatabaseBackup
|
|
12
12
|
environment: -> { default_environment },
|
13
13
|
backup_name: -> { default_backup_name },
|
14
14
|
backup_tmp_path: -> { default_backup_tmp_path },
|
15
|
-
uploader: -> {
|
15
|
+
uploader: -> { build_uploader }
|
16
16
|
|
17
17
|
|
18
18
|
def backup_latest_dump
|
@@ -33,6 +33,14 @@ module NxtHerokuDatabaseBackup
|
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
+
def build_uploader
|
37
|
+
Uploader::S3.build(
|
38
|
+
bucket_name: upload_destination,
|
39
|
+
file_path: encrypted_backup_tmp_path,
|
40
|
+
backup_name: backup_name
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
36
44
|
def upload_backup
|
37
45
|
uploader.call
|
38
46
|
end
|
@@ -5,14 +5,19 @@ module NxtHerokuDatabaseBackup
|
|
5
5
|
|
6
6
|
attr_init :bucket_name, :file_path, :credentials
|
7
7
|
|
8
|
-
def self.build(bucket_name:, file_path:, credentials: nil)
|
8
|
+
def self.build(bucket_name:, file_path:, backup_name:, credentials: nil)
|
9
9
|
credentials ||= {
|
10
10
|
access_key_id: ENV.fetch('DATABASE_BACKUP_AWS_ACCESS_KEY_ID'),
|
11
11
|
secret_access_key: ENV.fetch('DATABASE_BACKUP_AWS_SECRET_ACCESS_KEY'),
|
12
12
|
region: ENV.fetch('DATABASE_BACKUP_AWS_REGION')
|
13
13
|
}
|
14
14
|
|
15
|
-
new(
|
15
|
+
new(
|
16
|
+
bucket_name: bucket_name,
|
17
|
+
file_path: file_path,
|
18
|
+
backup_name: backup_name,
|
19
|
+
credentials: credentials
|
20
|
+
)
|
16
21
|
end
|
17
22
|
|
18
23
|
def call
|