rubypitaya 1.6.1 → 1.8.0

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
  SHA256:
3
- metadata.gz: ca8b3f228a70fa12fad3f4c813354ec41e924c78786044da97804c00c1766404
4
- data.tar.gz: 48dde9ca6f70a0a161451173ab9014398ddde0f0eebd9982b0c2c4f35461e3c7
3
+ metadata.gz: 25a391f0036f4e8d9d60c427347d04209b84641a40059920090f2b686e5f11a5
4
+ data.tar.gz: 5dde38895cdbb78395d6dcd0fd9da14bdbed2157c6034ab2c110e732d6214a8e
5
5
  SHA512:
6
- metadata.gz: 2ebec6b4e01a88a4c8ebda46aaaa850874425d7fdb577f1cfa4657f992fd2f182236e3548ab513bb4f8d27ae8e86940ae1cf38e77963d35188645cc717719578
7
- data.tar.gz: dee2ad020e8b54d91b2713da3fd407236857c796ae1b02d0b77a3ff6c9f8b9883678764cfa84e0a30c9588fed619dfc9b1b72f2694f77f0ce2192cb50165a879
6
+ metadata.gz: 8dce4ee9cb61f16efa395ced25a7bd40727e4136921c44c0a1694242be1eb47030ab1b8845f32079836a621000cc9847d2918b1d673a6b9e5c0a49047ac633de
7
+ data.tar.gz: 7fc2a58cc9e0dc34e76b3fa08f8337604cf32eaef3a7e93e684d3d5b5a6f1fc1ae68e669a019befeef05e42ead5c65bb378c7438902b9a3f0105f06dfc12325b
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '1.6.1'
3
+ gem 'rubypitaya', '1.8.0'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.12.2'
@@ -62,7 +62,7 @@ GEM
62
62
  diff-lcs (>= 1.2.0, < 2.0)
63
63
  rspec-support (~> 3.8.0)
64
64
  rspec-support (3.8.3)
65
- rubypitaya (1.6.1)
65
+ rubypitaya (1.8.0)
66
66
  activerecord (= 6.0.2)
67
67
  etcdv3 (= 0.10.2)
68
68
  eventmachine (= 1.2.7)
@@ -85,7 +85,7 @@ DEPENDENCIES
85
85
  pry (= 0.12.2)
86
86
  rake (= 10.0)
87
87
  rspec (= 3.8.0)
88
- rubypitaya (= 1.6.1)
88
+ rubypitaya (= 1.8.0)
89
89
 
90
90
  BUNDLED WITH
91
91
  1.17.2
@@ -44,7 +44,15 @@ generate-gemfilelock:
44
44
 
45
45
  ## Build image to production environment
46
46
  prod-build-image:
47
- @docker build . -f docker/prod/Dockerfile -t rubypitaya-prod:latest
47
+ @docker build . -f docker/prod/Dockerfile -t [registry-address]:$(IMAGE_TAG)
48
+
49
+ ## Push prod image to gitlab
50
+ prod-push-image:
51
+ @docker push [registry-address]:$(IMAGE_TAG)
52
+
53
+ ## Deploy prod image to kubernetes cluster
54
+ prod-deploy-image:
55
+ kubectl -n $(PROD_NAMESPACE) set image deployment rubypitaya rubypitaya=[registry-address]:$(IMAGE_TAG)
48
56
 
49
57
  .DEFAULT_GOAL := show-help
50
58
 
@@ -1,15 +1,22 @@
1
1
  class StatusCodes
2
- # Success codes
3
- CODE_OK = 'RP-200'
4
2
 
5
- # Error codes
6
- CODE_UNKNOWN = 'RP-000'
7
- CODE_HANDLER_NOT_FOUNDED = 'RP-001'
8
- CODE_ACTION_NOT_FOUNDED = 'RP-002'
9
- CODE_NOT_AUTHENTICATED = 'RP-003'
10
- CODE_AUTHENTICATION_ERROR = 'RP-004'
3
+ CODE_OK = RubyPitaya::StatusCodes::CODE_OK
11
4
 
12
- class Connector
13
- CODE_UNKNOWN = 'PIT-000'
14
- end
5
+ ################
6
+ ## Existent Codes
7
+ ################
8
+ ## Success codes
9
+ #
10
+ # RubyPitaya::StatusCodes::CODE_OK = 'RP-200'
11
+ #
12
+ #
13
+ ## Error codes
14
+ # RubyPitaya::StatusCodes::CODE_UNKNOWN = 'RP-000'
15
+ # RubyPitaya::StatusCodes::CODE_HANDLER_NOT_FOUNDED = 'RP-001'
16
+ # RubyPitaya::StatusCodes::CODE_ACTION_NOT_FOUNDED = 'RP-002'
17
+ # RubyPitaya::StatusCodes::CODE_NOT_AUTHENTICATED = 'RP-003'
18
+ # RubyPitaya::StatusCodes::CODE_AUTHENTICATION_ERROR = 'RP-004'
19
+ #
20
+ # RubyPitaya::StatusCodes::Connector::CODE_UNKNOWN = 'PIT-000'
21
+ ################
15
22
  end
@@ -12,7 +12,7 @@ services:
12
12
  - '2380:2380'
13
13
 
14
14
  redis:
15
- image: 'redis:3.2.5-alpine'
15
+ image: 'redis:6.0.5-alpine'
16
16
  ports:
17
17
  - '9001:6379'
18
18
 
@@ -22,7 +22,7 @@ services:
22
22
  - 'postgres:/var/lib/postgresql/data'
23
23
  environment:
24
24
  POSTGRES_USER: 'postgres'
25
- POSTGRES_HOST_AUTH_METHOD: 'trust'
25
+ POSTGRES_PASSWORD: 'postgres'
26
26
  ports:
27
27
  - '9100:5432'
28
28
 
@@ -67,7 +67,7 @@ services:
67
67
  REDIS_URL: 'redis://redis:6379'
68
68
  DATABASE_HOST: 'db'
69
69
  DATABASE_USER: 'postgres'
70
- DATABASE_PASSWORD: ''
70
+ DATABASE_PASSWORD: 'postgres'
71
71
  DATABASE_NAME: 'ruby_pitaya'
72
72
 
73
73
  volumes:
@@ -16,4 +16,4 @@ ENV LC_ALL=C.UTF-8
16
16
 
17
17
  ENTRYPOINT ["./docker/entrypoint.sh"]
18
18
 
19
- CMD ["bundle", "exec", "rubypitaya"]
19
+ CMD ["bundle", "exec", "rubypitaya", "run"]
@@ -29,4 +29,4 @@ ENV LC_ALL=C.UTF-8
29
29
 
30
30
  ENTRYPOINT ["./docker/entrypoint.sh"]
31
31
 
32
- CMD ["bundle", "exec", "rubypitaya"]
32
+ CMD ["bundle", "exec", "rubypitaya", "run"]
@@ -41,7 +41,7 @@ spec:
41
41
  - name: DATABASE_USER
42
42
  value: "postgres"
43
43
  - name: DATABASE_PASSWORD
44
- value: ""
44
+ value: "postgres"
45
45
  - name: DATABASE_NAME
46
46
  value: "ruby_pitaya"
47
47
  imagePullSecrets:
@@ -19,8 +19,10 @@ spec:
19
19
  - name: postgres
20
20
  image: postgres:9.6.17
21
21
  env:
22
- - name: POSTGRES_HOST_AUTH_METHOD
23
- value: "trust"
22
+ - name: POSTGRES_USER
23
+ value: "postgres"
24
+ - name: POSTGRES_PASSWORD
25
+ value: "postgres"
24
26
  - name: PGDATA
25
27
  value: "/var/lib/postgresql/data/pgdata"
26
28
  ports:
@@ -17,7 +17,7 @@ spec:
17
17
  spec:
18
18
  containers:
19
19
  - name: redis
20
- image: redis:3.2.5-alpine
20
+ image: redis:6.0.5-alpine
21
21
  ports:
22
22
  - containerPort: 6379
23
23
  name: redis
@@ -25,6 +25,7 @@ module RubyPitaya
25
25
  'pool': config['pool'],
26
26
  'host': config['host'],
27
27
  'user': config['user'],
28
+ 'password': config['password'],
28
29
  'database': config['database'],
29
30
  }
30
31
  end
@@ -36,6 +37,7 @@ module RubyPitaya
36
37
  'pool': config['pool'],
37
38
  'host': config['host'],
38
39
  'user': config['user'],
40
+ 'password': config['password'],
39
41
  }
40
42
  end
41
43
 
@@ -8,6 +8,7 @@ require 'rubypitaya/core/session'
8
8
  require 'rubypitaya/core/postman'
9
9
  require 'rubypitaya/core/parameters'
10
10
  require 'rubypitaya/core/routes_base'
11
+ require 'rubypitaya/core/status_codes'
11
12
  require 'rubypitaya/core/handler_router'
12
13
  require 'rubypitaya/core/etcd_connector'
13
14
  require 'rubypitaya/core/nats_connector'
@@ -12,15 +12,14 @@ module RubyPitaya
12
12
  end
13
13
 
14
14
  def connect
15
- @redis = Redis.new(url: @redis_address)
15
+ @redis = Redis.new(
16
+ url: @redis_address,
17
+ :reconnect_attempts => 10,
18
+ :reconnect_delay => 1.5,
19
+ :reconnect_delay_max => 2.0,
20
+ )
16
21
 
17
- test_connection
18
- end
19
-
20
- def test_connection
21
- @redis.set('tmp', 'value')
22
- @redis.get('tmp')
23
- @redis.del('tmp')
22
+ @redis.ping
24
23
  end
25
24
  end
26
25
  end
@@ -0,0 +1,18 @@
1
+ module RubyPitaya
2
+
3
+ class StatusCodes
4
+ # Success codes
5
+ CODE_OK = 'RP-200'
6
+
7
+ # Error codes
8
+ CODE_UNKNOWN = 'RP-000'
9
+ CODE_HANDLER_NOT_FOUNDED = 'RP-001'
10
+ CODE_ACTION_NOT_FOUNDED = 'RP-002'
11
+ CODE_NOT_AUTHENTICATED = 'RP-003'
12
+ CODE_AUTHENTICATION_ERROR = 'RP-004'
13
+
14
+ class Connector
15
+ CODE_UNKNOWN = 'PIT-000'
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = "1.6.1"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypitaya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Prestes Cavalcanti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-20 00:00:00.000000000 Z
11
+ date: 2020-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -201,7 +201,6 @@ files:
201
201
  - "./lib/rubypitaya/app-template/app/handlers/player_handler.rb"
202
202
  - "./lib/rubypitaya/app-template/app/models/player.rb"
203
203
  - "./lib/rubypitaya/app-template/app/models/user.rb"
204
- - "./lib/rubypitaya/app-template/apptemplate-0.1.0.gem"
205
204
  - "./lib/rubypitaya/app-template/bin/console"
206
205
  - "./lib/rubypitaya/app-template/config/database.yml"
207
206
  - "./lib/rubypitaya/app-template/config/routes.rb"
@@ -245,6 +244,7 @@ files:
245
244
  - "./lib/rubypitaya/core/redis_connector.rb"
246
245
  - "./lib/rubypitaya/core/routes_base.rb"
247
246
  - "./lib/rubypitaya/core/session.rb"
247
+ - "./lib/rubypitaya/core/status_codes.rb"
248
248
  - "./lib/rubypitaya/version.rb"
249
249
  - bin/rubypitaya
250
250
  homepage: https://gitlab.com/LucianoPC/ruby-pitaya