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 +4 -4
- data/lib/rubypitaya/app-template/Gemfile +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- data/lib/rubypitaya/app-template/Makefile +9 -1
- data/lib/rubypitaya/app-template/app/constants/status_codes.rb +18 -11
- data/lib/rubypitaya/app-template/docker-compose.yml +3 -3
- data/lib/rubypitaya/app-template/docker/dev/Dockerfile +1 -1
- data/lib/rubypitaya/app-template/docker/prod/Dockerfile +1 -1
- data/lib/rubypitaya/app-template/kubernetes/deployment-rubypitaya.yaml +1 -1
- data/lib/rubypitaya/app-template/kubernetes/statefulset-postgres.yaml +4 -2
- data/lib/rubypitaya/app-template/kubernetes/statefulset-redis.yaml +1 -1
- data/lib/rubypitaya/core/database_config.rb +2 -0
- data/lib/rubypitaya/core/main.rb +1 -0
- data/lib/rubypitaya/core/redis_connector.rb +7 -8
- data/lib/rubypitaya/core/status_codes.rb +18 -0
- data/lib/rubypitaya/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25a391f0036f4e8d9d60c427347d04209b84641a40059920090f2b686e5f11a5
|
4
|
+
data.tar.gz: 5dde38895cdbb78395d6dcd0fd9da14bdbed2157c6034ab2c110e732d6214a8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dce4ee9cb61f16efa395ced25a7bd40727e4136921c44c0a1694242be1eb47030ab1b8845f32079836a621000cc9847d2918b1d673a6b9e5c0a49047ac633de
|
7
|
+
data.tar.gz: 7fc2a58cc9e0dc34e76b3fa08f8337604cf32eaef3a7e93e684d3d5b5a6f1fc1ae68e669a019befeef05e42ead5c65bb378c7438902b9a3f0105f06dfc12325b
|
@@ -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.
|
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.
|
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
|
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
|
-
|
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
|
-
|
13
|
-
|
14
|
-
|
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:
|
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
|
-
|
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:
|
@@ -19,8 +19,10 @@ spec:
|
|
19
19
|
- name: postgres
|
20
20
|
image: postgres:9.6.17
|
21
21
|
env:
|
22
|
-
- name:
|
23
|
-
value: "
|
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:
|
@@ -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
|
|
data/lib/rubypitaya/core/main.rb
CHANGED
@@ -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(
|
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
|
-
|
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
|
data/lib/rubypitaya/version.rb
CHANGED
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.
|
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-
|
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
|