backy_rb 0.2.0 → 0.2.1

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: a7cc1e70142f6fa0c98d12c5e1187e05596a847e58ff13060b49d713bea3189c
4
- data.tar.gz: 702727d108936670bcfa86a203cd67c672eb0dfb2a3f84d4f22e538962c2e151
3
+ metadata.gz: b7bb1c2b1110d5fe15106b8bb78e8e07201e2318156aa6f67a4349eb92720a06
4
+ data.tar.gz: 5a8ae6f47b04ac3480cecedf77987166d5d630cc511496a734cddf5f7659e871
5
5
  SHA512:
6
- metadata.gz: 16e3cc5cecf30e88be20ed71685cd5c615ace3ad960f0bcca92c03cda64f0c586da5d6905072e99c3fac2b334e598e46588eb438a0406dd10956a73fb1d4ec78
7
- data.tar.gz: 55e8e14e5edb195cc882abe7cf4568cbb986d1e39b955c198fea5f25091b0adc00e42136b8ccd6df5a522ddf61662a4ee0ff617ee877221fc6540f91b7813aee
6
+ metadata.gz: 956ae711507992a7c75a3340d108b2df9e8da541ce9e90d346b1c0249bd22a414a6bf41f5e78f901f8b81ec68fd626a6f4cafbc8833d02a6eaea5f55563a0796
7
+ data.tar.gz: ca0b9c66ff07d33bd204df31e400690e53ca3a7108d8267eed734e9f5bc3d280046d1033856fbf13f89c297c38821d212ae573f4ea1d30b49eda95eb135bb624
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to `Backy` will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
+ ## [0.2.1] - 2024-06-24
7
+ ### Fixed
8
+ - Fix bug where `push` is not working because of missing filename
9
+
6
10
  ## [0.2.0] - 2024-06-24
7
11
  ### Added
8
12
  - Support for turning off replication
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backy_rb (0.2.0)
4
+ backy_rb (0.2.1)
5
5
  activerecord (>= 4.0)
6
6
  activesupport (>= 4.0)
7
7
  aws-sdk-s3 (>= 1.117)
data/README.md CHANGED
@@ -68,18 +68,19 @@ Backy can be configured through a .backyrc YAML file. Place this file in your ho
68
68
  Example `.backyrc`:
69
69
 
70
70
  ```yaml
71
- shared:
71
+ defaults:
72
72
  use_parallel: true
73
- pause_replication: true
74
- s3_access_key_id: YOUR_ACCESS_KEY
75
- s3_secret_access_key: YOUR_SECRET_KEY
76
- s3_region: YOUR_REGION
77
- s3_bucket: YOUR_BUCKET
78
- pg_host: DB_HOST
79
- pg_port: DB_PORT
80
- pg_username: DB_USERNAME
81
- pg_password: DB_PASSWORD
82
- pg_database: DB_NAME
73
+ s3:
74
+ access_key_id: YOUR_ACCESS_KEY
75
+ secret_access_key: YOUR_SECRET_KEY
76
+ region: YOUR_REGION
77
+ bucket: YOUR_BUCKET
78
+ database:
79
+ host: DB_HOST
80
+ port: DB_PORT
81
+ username: DB_USERNAME
82
+ password: DB_PASSWORD
83
+ database_name: DB_NAME
83
84
  ```
84
85
 
85
86
  ## Development
data/lib/backy/pg_dump.rb CHANGED
@@ -14,15 +14,17 @@ module Backy
14
14
  setup_backup_directory
15
15
  log_start
16
16
 
17
+ dump_file = nil
18
+
17
19
  begin
18
- handle_replication { backup }
20
+ handle_replication { dump_file = backup }
19
21
  rescue => e
20
22
  Logger.error("An error occurred during backup: #{e.message}")
21
23
  ensure
22
- if replica? && pause_replication?
23
- log_replication_resume
24
- end
24
+ log_replication_resume if replica? && pause_replication?
25
25
  end
26
+
27
+ dump_file
26
28
  end
27
29
 
28
30
  private
@@ -75,6 +77,8 @@ module Backy
75
77
  Logger.log("Saving to #{dump_file} ... ")
76
78
 
77
79
  execute_command(cmd, "error. See #{log_file}")
80
+
81
+ dump_file
78
82
  end
79
83
 
80
84
  def parallel_backup
@@ -91,10 +95,16 @@ module Backy
91
95
  execute_command(cleanup_cmd, "Cleanup failed. See #{log_file} for details.")
92
96
 
93
97
  Logger.success("Backup process completed. Output file: #{dump_file}")
98
+
99
+ dump_file
94
100
  end
95
101
 
96
102
  def execute_command(cmd, error_message)
97
- Logger.error(error_message) unless system(cmd)
103
+ if system(cmd)
104
+ Logger.success("done")
105
+ else
106
+ Logger.error(error_message)
107
+ end
98
108
  end
99
109
 
100
110
  def current_timestamp
data/lib/backy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Backy
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backy_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Kharchenko