souls 0.7.9 → 0.8.4
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/.rubocop.yml +4 -0
- data/Gemfile.lock +1 -1
- data/exe/souls +9 -4
- data/lib/souls.rb +18 -11
- data/lib/souls/init.rb +4 -12
- data/lib/souls/version.rb +1 -1
- data/souls.gemspec +2 -2
- data/v0.0.8.tar.gz +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b74eb05a7580c397e60b046e42396460e5420d458e8d59c14dfc83ea7321336
|
|
4
|
+
data.tar.gz: 75f8d7fdc50574b803729dae7d494b9a9d734041a33d23d917ad4dfa3cafe5ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc4d537ffd2fc5356aa9c5b09cbd7ff5f90f81632543374678ae9dfca77fed20e589cd2879fbfa73a546c733eaf01de12d4b37377dd9a094e1aff1dcc9f03c7a
|
|
7
|
+
data.tar.gz: c91f880c56d08b41e99964ef5c8cdc5b30ed1c52f49ddc78ed5e0237f7c1fa7ad68d3d9aeb87b5e65e2dd6238d96407c5e27107f41020c00ce7b762f4243a1e2
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/exe/souls
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
require "souls"
|
|
3
3
|
|
|
4
4
|
begin
|
|
5
|
-
|
|
5
|
+
begin
|
|
6
|
+
require "./config/initializers/souls" unless ARGV[0] == "new"
|
|
7
|
+
rescue
|
|
8
|
+
Souls::Init.config_init
|
|
9
|
+
end
|
|
6
10
|
case ARGV[0]
|
|
7
11
|
when "new"
|
|
8
12
|
if ARGV[1].nil?
|
|
@@ -38,7 +42,7 @@ begin
|
|
|
38
42
|
when "p", "proto"
|
|
39
43
|
Souls::Init.proto proto_package_name: "souls", service: ARGV[1]
|
|
40
44
|
when "init"
|
|
41
|
-
Souls::Init.
|
|
45
|
+
Souls::Init.config_init
|
|
42
46
|
when "-v", "--version"
|
|
43
47
|
puts Souls::VERSION
|
|
44
48
|
when "g", "generate"
|
|
@@ -57,11 +61,12 @@ begin
|
|
|
57
61
|
`bundle exec rspec`
|
|
58
62
|
end
|
|
59
63
|
when "deploy"
|
|
60
|
-
|
|
64
|
+
project_id = Souls.configuration.project_id
|
|
65
|
+
`gcloud builds submit --config=cloudbuild.yml --project #{project_id}`
|
|
61
66
|
else
|
|
62
67
|
puts "Welcome to Souls!Yeah!"
|
|
63
68
|
end
|
|
64
69
|
rescue StandardError => error
|
|
65
70
|
puts error
|
|
66
71
|
puts "Thank you!Souls!"
|
|
67
|
-
end
|
|
72
|
+
end
|
data/lib/souls.rb
CHANGED
|
@@ -125,7 +125,7 @@ module Souls
|
|
|
125
125
|
def export_network_group
|
|
126
126
|
app = Souls.configuration.app
|
|
127
127
|
system "NEG_NAME=$(gcloud compute network-endpoint-groups list | grep #{app} | awk '{print $1}')"
|
|
128
|
-
`echo $NEG_NAME > ./
|
|
128
|
+
`echo $NEG_NAME > ./config/neg_name`
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
def delete_network_group_list neg_name:
|
|
@@ -149,11 +149,6 @@ module Souls
|
|
|
149
149
|
system "gcloud config set project #{project_id}"
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
def config_set
|
|
153
|
-
project_id = Souls.configuration.project_id
|
|
154
|
-
system "gcloud config set project #{project_id}"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
152
|
def create_cluster
|
|
158
153
|
app = Souls.configuration.app
|
|
159
154
|
network = Souls.configuration.network
|
|
@@ -266,6 +261,9 @@ module Souls
|
|
|
266
261
|
`gcloud services enable container.googleapis.com`
|
|
267
262
|
`gcloud services enable containerregistry.googleapis.com`
|
|
268
263
|
`gcloud services enable servicenetworking.googleapis.com`
|
|
264
|
+
`gcloud services enable sqladmin.googleapis.com`
|
|
265
|
+
`gcloud services enable sql-component.googleapis.com`
|
|
266
|
+
`gcloud services enable cloudbuild.googleapis.com`
|
|
269
267
|
end
|
|
270
268
|
|
|
271
269
|
def update_container zone: :asia
|
|
@@ -376,13 +374,19 @@ module Souls
|
|
|
376
374
|
-v postgres-tmp:/var/lib/postgresql/data \
|
|
377
375
|
-e POSTGRES_USER=postgres \
|
|
378
376
|
-e POSTGRES_PASSWORD=postgres \
|
|
379
|
-
-e POSTGRES_DB=
|
|
380
|
-
postgres:
|
|
381
|
-
|
|
377
|
+
-e POSTGRES_DB=souls_test \
|
|
378
|
+
postgres:13-alpine`
|
|
379
|
+
`docker ps`
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
def run_awake
|
|
383
|
+
app = Souls.configuration.app
|
|
384
|
+
`gcloud scheduler jobs create http #{app}-awake --schedule "0,10,20,30,40,50 * * * *" --uri "https://#{app}.el-soul.com" --http-method GET`
|
|
382
385
|
end
|
|
383
386
|
|
|
384
387
|
def deploy_local
|
|
385
388
|
`docker network create --driver bridge shared`
|
|
389
|
+
|
|
386
390
|
`docker run -d --name proxy \
|
|
387
391
|
-p 80:80 -p 443:443 \
|
|
388
392
|
-v "/var/run/docker.sock:/tmp/docker.sock:ro" \
|
|
@@ -392,6 +396,7 @@ module Souls
|
|
|
392
396
|
--network shared \
|
|
393
397
|
--restart always \
|
|
394
398
|
jwilder/nginx-proxy`
|
|
399
|
+
|
|
395
400
|
`docker run -d --name letsencrypt \
|
|
396
401
|
-v "/home/certs:/etc/nginx/certs" \
|
|
397
402
|
-v "/var/run/docker.sock:/var/run/docker.sock:ro" \
|
|
@@ -399,6 +404,7 @@ module Souls
|
|
|
399
404
|
--network shared \
|
|
400
405
|
--restart always \
|
|
401
406
|
jrcs/letsencrypt-nginx-proxy-companion`
|
|
407
|
+
|
|
402
408
|
`docker run -d --name nginx \
|
|
403
409
|
-p 80:80 \
|
|
404
410
|
-e VIRTUAL_HOST=souls.el-soul.com \
|
|
@@ -406,11 +412,12 @@ module Souls
|
|
|
406
412
|
-e LETSENCRYPT_EMAIL=info@gmail.com \
|
|
407
413
|
--network shared \
|
|
408
414
|
--link web \
|
|
409
|
-
poppinfumi/nginx
|
|
415
|
+
poppinfumi/ruby-nginx:latest`
|
|
416
|
+
|
|
410
417
|
`docker run -d --name web \
|
|
411
418
|
-p 3000:3000 \
|
|
412
419
|
--network shared \
|
|
413
|
-
|
|
420
|
+
poppinfumi/souls_api`
|
|
414
421
|
end
|
|
415
422
|
end
|
|
416
423
|
|
data/lib/souls/init.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Souls
|
|
|
12
12
|
project[:main_project_id] == "" ? project[:main_project_id] = "elsoul2" : true
|
|
13
13
|
puts "Google Cloud PROJECT_ID: (default: elsoul2)"
|
|
14
14
|
project[:project_id] = STDIN.gets.chomp
|
|
15
|
-
project[:project_id]
|
|
15
|
+
project[:project_id] = "elsoul2" if project[:project_id] == ""
|
|
16
16
|
puts "VPC Network Name: (default: default)"
|
|
17
17
|
project[:network] = STDIN.gets.chomp
|
|
18
18
|
project[:network] == "" ? project[:network] = "default" : true
|
|
@@ -49,6 +49,7 @@ module Souls
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def config_init app_name: "souls", project: {}
|
|
52
|
+
puts "Generating souls conf..."
|
|
52
53
|
file_path = "#{app_name}/config/initializers/souls.rb"
|
|
53
54
|
File.open(file_path, "w") do |f|
|
|
54
55
|
f.write <<~EOS
|
|
@@ -83,7 +84,7 @@ module Souls
|
|
|
83
84
|
system "tar -zxvf ./#{version}.tar.gz"
|
|
84
85
|
system "mkdir #{app_name}"
|
|
85
86
|
folder = version.delete "v"
|
|
86
|
-
system "cp -
|
|
87
|
+
system "cp -r #{repository_name}-#{folder}/ #{app_name}/"
|
|
87
88
|
system "rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}"
|
|
88
89
|
txt = <<~TEXT
|
|
89
90
|
_____ ____ __ ____
|
|
@@ -103,13 +104,6 @@ module Souls
|
|
|
103
104
|
|
|
104
105
|
def proto proto_package_name: "souls", service: "blog"
|
|
105
106
|
system "grpc_tools_ruby_protoc -I ./protos --ruby_out=./app/services --grpc_out=./app/services ./protos/#{service}.proto"
|
|
106
|
-
file_path = "./app/services/#{service}_pb.rb"
|
|
107
|
-
File.open(file_path, "a") do |f|
|
|
108
|
-
f.write <<~EOS
|
|
109
|
-
module #{service.capitalize}Pb
|
|
110
|
-
end
|
|
111
|
-
EOS
|
|
112
|
-
end
|
|
113
107
|
service_pb_path = "./app/services/#{service}_services_pb.rb"
|
|
114
108
|
new_file = "./app/services/#{proto_package_name}.rb"
|
|
115
109
|
File.open(new_file, "w") do |new_line|
|
|
@@ -120,8 +114,6 @@ module Souls
|
|
|
120
114
|
new_line.write "# Generated by the SOULs protocol buffer compiler. DO NOT EDIT!\n"
|
|
121
115
|
when 3
|
|
122
116
|
next
|
|
123
|
-
when 4
|
|
124
|
-
new_line.write "require_relative \"#{service}_pb\""
|
|
125
117
|
else
|
|
126
118
|
puts "#{i}: #{line}"
|
|
127
119
|
new_line.write line.to_s
|
|
@@ -152,7 +144,7 @@ module Souls
|
|
|
152
144
|
Souls.create_firewall_rule firewall_rule_name: firewall_rule_name
|
|
153
145
|
Souls.create_backend_service service_name: service_name, health_check_name: health_check_name
|
|
154
146
|
Souls.export_network_group
|
|
155
|
-
file_path = "./
|
|
147
|
+
file_path = "./config/neg_name"
|
|
156
148
|
File.open(file_path) do |f|
|
|
157
149
|
Souls.add_backend_service service_name: service_name, neg_name: f.gets.to_s, zone: zone
|
|
158
150
|
end
|
data/lib/souls/version.rb
CHANGED
data/souls.gemspec
CHANGED
|
@@ -3,8 +3,8 @@ require_relative 'lib/souls/version'
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "souls"
|
|
5
5
|
spec.version = Souls::VERSION
|
|
6
|
-
spec.authors = ["POPPIN-FUMI", "KishiTheMechanic"]
|
|
7
|
-
spec.email = ["fumitake.kawasaki@el-soul.com", "shota.kishi@el-soul.com"]
|
|
6
|
+
spec.authors = ["POPPIN-FUMI", "KishiTheMechanic", "James Neve"]
|
|
7
|
+
spec.email = ["fumitake.kawasaki@el-soul.com", "shota.kishi@el-soul.com", "jamesoneve@gmail.com"]
|
|
8
8
|
|
|
9
9
|
spec.summary = "SOULS is a Web Application Framework for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems."
|
|
10
10
|
spec.description = "SOULS is a Web Application Framework for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems."
|
data/v0.0.8.tar.gz
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: souls
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- POPPIN-FUMI
|
|
8
8
|
- KishiTheMechanic
|
|
9
|
+
- James Neve
|
|
9
10
|
autorequire:
|
|
10
11
|
bindir: exe
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date: 2021-01-
|
|
13
|
+
date: 2021-01-19 00:00:00.000000000 Z
|
|
13
14
|
dependencies: []
|
|
14
15
|
description: SOULS is a Web Application Framework for Microservices on Multi Cloud
|
|
15
16
|
Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
|
|
@@ -18,6 +19,7 @@ description: SOULS is a Web Application Framework for Microservices on Multi Clo
|
|
|
18
19
|
email:
|
|
19
20
|
- fumitake.kawasaki@el-soul.com
|
|
20
21
|
- shota.kishi@el-soul.com
|
|
22
|
+
- jamesoneve@gmail.com
|
|
21
23
|
executables:
|
|
22
24
|
- souls
|
|
23
25
|
extensions: []
|