pg_easy_replicate 0.1.2 → 0.1.3

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: a5df08d2cfc5874389ab9a5311a572a39ea76e5c2a56a53df3db935865caeb99
4
- data.tar.gz: 156656c80d4d808bc1a623507e0a2da904f9c7ebd26ec9e767382aac90276d70
3
+ metadata.gz: c3e58d75f6e22242f3b833838eba69bfd72cb930ad5931ef77a5c0c4f49aded8
4
+ data.tar.gz: 8ff3c66b8ee6b37bcadb801f57fa668019fc7c36c5cabf5639c65d3b80813eae
5
5
  SHA512:
6
- metadata.gz: 47e224f6e9d1133f5a2eee992e42afddefdf89f908dc763c84d4e36547849f3e69824f47481df05d2552d7708240af75aa32f056e2cacf60293fdefe983fc2ed
7
- data.tar.gz: '0184bfa3eafd4224cc5eefa32f45fead0491e507e7df78e0395a06dd9ce22bd4b76ea59e4d253113e0fc3dbdbb73b548175d44f87a4acf070633657629310568'
6
+ metadata.gz: d337088ee7ccf6855c45328502c587172cd96fb4b57bb386a6774665277d5753533f7876fadc28d6088ab0ecfb4cc9e201245d8a05f83ca178f9dd6376df4a00
7
+ data.tar.gz: 8d44166f5ad25773462e952109b315195229e1127639296e3f4f56341823af60fd7feba3bef1ffcbd32cbb864cab28117bbedda3ceb9949aa96451296bc63a78
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.1.4
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- FROM ruby:3.0
1
+ FROM ruby:3.1.4
2
2
 
3
- ARG VERSION=0.1.2
3
+ ARG VERSION
4
4
 
5
5
  RUN gem install pg_easy_replicate -v $VERSION
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_easy_replicate (0.1.2)
4
+ pg_easy_replicate (0.1.3)
5
5
  lockbox (~> 1.2.0)
6
6
  ougai (~> 2.0.0)
7
7
  pg (~> 1.5.3)
data/README.md CHANGED
@@ -216,3 +216,11 @@ Next, you can set up a program that watches the `stats` and waits until `switcho
216
216
  In this strategy, you have a weighted based DNS system (example [AWS Route53 weighted records](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-weighted.html)) where 100% of traffic goes to a primary origin and 0% to a secondary origin. The primary origin here is the DNS host for your source database and secondary origin is the DNS host for your target database. You can set up your application ahead of time to interact with the database using DNS from the weighted group.
217
217
 
218
218
  Next, you can set up a program that watches the `stats` and waits until `switchover_completed_at` is reporting as `true`. Once that happens it updates the weight in the DNS weighted group where 100% of the requests now go to the new/target database. Note: Keeping a low `ttl` is recommended.
219
+
220
+ ## Contributing
221
+
222
+ PRs most welcome. You can get started locally by
223
+
224
+ - `docker compose down -v && docker compose up --remove-orphans --build`
225
+ - Install ruby `3.1.4` using RVM ([instruction](https://rvm.io/rvm/install#any-other-system))
226
+ - `bundle exec rspec` for specs
data/bin/release.sh CHANGED
@@ -1,10 +1,6 @@
1
1
  export VERSION=$1
2
2
  echo "VERSION: ${VERSION}"
3
3
 
4
- # echo "=== Pushing tags to github ===="
5
- # git tag v"$VERSION"
6
- # git push origin --tags
7
-
8
4
  echo "=== Building Gem ===="
9
5
  gem build pg_easy_replicate.gemspec
10
6
 
@@ -14,15 +10,9 @@ gem push pg_easy_replicate-"$VERSION".gem
14
10
  echo "=== Sleeping for 5s ===="
15
11
  sleep 5
16
12
 
17
- echo "=== Building Image ===="
18
- docker build . --build-arg VERSION="$VERSION" -t shayonj/pg_easy_replicate:"$VERSION"
19
-
20
- echo "=== Tagging Image ===="
21
- docker image tag shayonj/pg_easy_replicate:"$VERSION" shayonj/pg_easy_replicate:latest
22
-
23
- echo "=== Pushing Image ===="
24
- docker push shayonj/pg_easy_replicate:"$VERSION"
25
- docker push shayonj/pg_easy_replicate:latest
13
+ # echo "=== Pushing tags to github ===="
14
+ # git tag v"$VERSION"
15
+ # git push origin --tags
26
16
 
27
- echo "=== Cleaning up ===="
28
- rm pg_easy_replicate-"$VERSION".gem
17
+ # echo "=== Cleaning up ===="
18
+ # rm pg_easy_replicate-"$VERSION".gem
data/docker-compose.yml CHANGED
@@ -1,32 +1,34 @@
1
1
  version: "3.7"
2
2
  services:
3
3
  source_db:
4
- image: postgres:12-alpine
4
+ image: postgres:12
5
5
  ports:
6
6
  - "5432:5432"
7
7
  environment:
8
8
  POSTGRES_USER: jamesbond
9
9
  POSTGRES_PASSWORD: jamesbond
10
10
  POSTGRES_DB: postgres
11
- command:
12
- - "postgres"
13
- - "-c"
14
- - "wal_level=logical"
11
+ command: >
12
+ -c wal_level=logical
13
+ -c ssl=on
14
+ -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
15
+ -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
15
16
  networks:
16
17
  localnet:
17
18
 
18
19
  target_db:
19
- image: postgres:12-alpine
20
+ image: postgres:12
20
21
  ports:
21
22
  - "5433:5432"
22
23
  environment:
23
24
  POSTGRES_USER: jamesbond
24
25
  POSTGRES_PASSWORD: jamesbond
25
26
  POSTGRES_DB: postgres
26
- command:
27
- - "postgres"
28
- - "-c"
29
- - "wal_level=logical"
27
+ command: >
28
+ -c wal_level=logical
29
+ -c ssl=on
30
+ -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
31
+ -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
30
32
  networks:
31
33
  localnet:
32
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgEasyReplicate
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_easy_replicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shayon Mukherjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lockbox