nxt_heroku_database_backup 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nxt_heroku_database_backup/uploader/s3.rb +21 -15
- data/lib/nxt_heroku_database_backup/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce3a0d811ceccd906a6cdf5b35ef0445dce65fefa4a9df9bcb38c7e2599205d8
|
4
|
+
data.tar.gz: 347647730fba6237575f5e8c50e1aa309436a7e21f93320356eb6eb9b1d2d776
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3a3ecf8106dd0e0599dbdd0669d5158f47f9baf1ff692b29cb1c38a7d35b2afa2da56ac1a6bd7d2eee3aafede7b4e463e491b241b4f11e92e84b7cb6164dc4f
|
7
|
+
data.tar.gz: 84a4c20c9a660b39998cadae86acbe1f2157a45246ce368044a1db23664334558e3a16c244143e880d34acfdf47e2ade03fe7184ff4eb04a15ad0d563293121c
|
data/Gemfile.lock
CHANGED
@@ -3,23 +3,29 @@ module NxtHerokuDatabaseBackup
|
|
3
3
|
class S3
|
4
4
|
include NxtInit
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
6
|
+
class << self
|
7
|
+
def build(bucket_name:, file_path:, backup_name:, credentials: default_credentials)
|
8
|
+
new(
|
9
|
+
bucket_name: bucket_name,
|
10
|
+
file_path: file_path,
|
11
|
+
backup_name: backup_name,
|
12
|
+
credentials: credentials
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def default_credentials
|
19
|
+
{
|
20
|
+
access_key_id: ENV.fetch('DATABASE_BACKUP_AWS_ACCESS_KEY_ID'),
|
21
|
+
secret_access_key: ENV.fetch('DATABASE_BACKUP_AWS_SECRET_ACCESS_KEY'),
|
22
|
+
region: ENV.fetch('DATABASE_BACKUP_AWS_REGION')
|
23
|
+
}
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
27
|
+
attr_init :bucket_name, :file_path, :credentials, :backup_name
|
28
|
+
|
23
29
|
def call
|
24
30
|
aws_object.upload_file(file_path)
|
25
31
|
end
|