souls 0.8.0 → 0.8.5

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: 560643126ebd83bbba6b537f3df4ff4dab5e071a4f5eaf95c4c80b41dfad178c
4
- data.tar.gz: 82f2814417af32ed219cd812c5f3f03239f6e612bbe357b70b98f61e31570ca3
3
+ metadata.gz: a57b96797a0a477562740a5cf08fbd5c4183f2fe493a70cb69566f5f1cda980b
4
+ data.tar.gz: 8a029707d19eda050c020c36600dda592d3f0a0451d05f51667343a5d6a8ad2f
5
5
  SHA512:
6
- metadata.gz: ee757a67e212e058cc07b35bc8d4c74af030e9e60a7e58312623349ea5c5a6bed113ff769dcdc2eb755a7445bad7e13ba5a069636be6be18f30bfe4f34f69486
7
- data.tar.gz: 97327b26bba04c5f4c8699540fa6a4708084c7d01a34730fb463d66a1b70ee41833c306cf4d8a9c3cc6daeff7a3d7c835ea15a7146d96f93a5dafba415369045
6
+ metadata.gz: f46f143cc597d71e62948f95226c7bbee91541063d8d6ea03f8fc77e46bdbeeff35373e709ba663b9c5b745e4a2524413ba0c11b4254738792f7265794d7c110
7
+ data.tar.gz: 0c608d8eda05af23a06ae4767e2b19d38e4c98f72a0136bded4e86c48ddc0c08731e5d07d99e3355f30135337fe70f1b9f457dd010216cb618f06d693af06d13
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.7.9)
4
+ souls (0.8.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,13 +1,14 @@
1
1
  Souls.configure do |config|
2
- config.project_id = "el-quest"
3
- config.app = "el-quest"
4
- config.namespace = "souls"
5
- config.service_name = "blog-service"
6
- config.network = "elsoul"
7
- config.machine_type = "elsoul"
8
- config.zone = "elsoul"
9
- config.domain = "elsoul"
10
- config.google_application_credentials = "./config/credentials.json"
11
- config.strain = "service"
2
+ config.main_project_id = ""
3
+ config.project_id = ""
4
+ config.app = "souls"
5
+ config.namespace = ""
6
+ config.service_name = ""
7
+ config.network = ""
8
+ config.machine_type = ""
9
+ config.zone = ""
10
+ config.domain = ""
11
+ config.google_application_credentials = ""
12
+ config.strain = ""
12
13
  config.proto_package_name = "souls"
13
14
  end
data/exe/souls CHANGED
@@ -2,7 +2,11 @@
2
2
  require "souls"
3
3
 
4
4
  begin
5
- require "./config/initializers/souls" unless ARGV[0] == "new"
5
+ begin
6
+ require "./config/initializers/souls" unless ARGV[0] == "new" || ARGV[0] == "init"
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.config
45
+ Souls::Init.config_init
42
46
  when "-v", "--version"
43
47
  puts Souls::VERSION
44
48
  when "g", "generate"
@@ -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 > ./infra/config/neg_name`
128
+ `echo $NEG_NAME > ./config/neg_name`
129
129
  end
130
130
 
131
131
  def delete_network_group_list neg_name:
@@ -41,14 +41,16 @@ module Souls
41
41
  confirm = STDIN.gets.chomp
42
42
  raise StandardError, "Retry" unless confirm == ""
43
43
  download_souls app_name: app_name, repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
44
- config_init app_name: app_name, project: project if config_needed.include?(strain)
44
+ initial_config_init app_name: app_name, project: project if config_needed.include?(strain)
45
45
  rescue StandardError => error
46
46
  puts error
47
47
  retry
48
48
  end
49
49
  end
50
50
 
51
- def config_init app_name: "souls", project: {}
51
+ def initial_config_init app_name: "souls", project: {}
52
+ puts "Generating souls conf..."
53
+ `touch "#{app_name}/config/initializers/souls.rb"`
52
54
  file_path = "#{app_name}/config/initializers/souls.rb"
53
55
  File.open(file_path, "w") do |f|
54
56
  f.write <<~EOS
@@ -70,6 +72,33 @@ module Souls
70
72
  end
71
73
  end
72
74
 
75
+ def config_init app_name: "souls", project: {}
76
+ `touch ./config/initializers/souls.rb`
77
+ file_path = "./config/initializers/souls.rb"
78
+ puts "Generating souls conf..."
79
+ sleep(rand(0.1..0.3))
80
+ puts "Generated!"
81
+ puts "Let's Edit SOULs Conf: `#{file_path}`"
82
+ File.open(file_path, "w") do |f|
83
+ f.write <<~EOS
84
+ Souls.configure do |config|
85
+ config.main_project_id = "#{project[:main_project_id]}"
86
+ config.project_id = "#{project[:project_id]}"
87
+ config.app = "#{app_name}"
88
+ config.namespace = "#{project[:namespace]}"
89
+ config.service_name = "#{project[:service_name]}"
90
+ config.network = "#{project[:network]}"
91
+ config.machine_type = "#{project[:machine_type]}"
92
+ config.zone = "#{project[:zone]}"
93
+ config.domain = "#{project[:domain]}"
94
+ config.google_application_credentials = "#{project[:google_application_credentials]}"
95
+ config.strain = "#{project[:strain]}"
96
+ config.proto_package_name = "souls"
97
+ end
98
+ EOS
99
+ end
100
+ end
101
+
73
102
  def get_version repository_name: "souls_service"
74
103
  data = JSON.parse `curl \
75
104
  -H "Accept: application/vnd.github.v3+json" \
@@ -83,7 +112,7 @@ module Souls
83
112
  system "tar -zxvf ./#{version}.tar.gz"
84
113
  system "mkdir #{app_name}"
85
114
  folder = version.delete "v"
86
- system "cp -aiv #{repository_name}-#{folder}/* #{app_name}/"
115
+ system "cp -r #{repository_name}-#{folder}/ #{app_name}/"
87
116
  system "rm -rf #{version}.tar.gz && rm -rf #{repository_name}-#{folder}"
88
117
  txt = <<~TEXT
89
118
  _____ ____ __ ____
@@ -103,13 +132,6 @@ module Souls
103
132
 
104
133
  def proto proto_package_name: "souls", service: "blog"
105
134
  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
135
  service_pb_path = "./app/services/#{service}_services_pb.rb"
114
136
  new_file = "./app/services/#{proto_package_name}.rb"
115
137
  File.open(new_file, "w") do |new_line|
@@ -120,8 +142,6 @@ module Souls
120
142
  new_line.write "# Generated by the SOULs protocol buffer compiler. DO NOT EDIT!\n"
121
143
  when 3
122
144
  next
123
- when 4
124
- new_line.write "require_relative \"#{service}_pb\""
125
145
  else
126
146
  puts "#{i}: #{line}"
127
147
  new_line.write line.to_s
@@ -152,7 +172,7 @@ module Souls
152
172
  Souls.create_firewall_rule firewall_rule_name: firewall_rule_name
153
173
  Souls.create_backend_service service_name: service_name, health_check_name: health_check_name
154
174
  Souls.export_network_group
155
- file_path = "./infra/config/neg_name"
175
+ file_path = "./config/neg_name"
156
176
  File.open(file_path) do |f|
157
177
  Souls.add_backend_service service_name: service_name, neg_name: f.gets.to_s, zone: zone
158
178
  end
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.5"
3
3
  end
@@ -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."
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.8.0
4
+ version: 0.8.5
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-08 00:00:00.000000000 Z
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: []