souls 1.1.2 → 1.3.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: e61ab5e9fda2ecba82fc00631402d0053da390c433dad7c3b7664c84a48688a7
4
- data.tar.gz: bba9d3da7ec7f49c56134ab29b3923f063db1afbcd45d06cec76c9a2601ddb77
3
+ metadata.gz: 2a268cc2c1da6a5192359f7ac46028f340b066ba8fd52b79f17639b1e0ee97fd
4
+ data.tar.gz: 571e1896e5ce83ea3813457cd3f4aa094d295b03340781b08f19b92cef626728
5
5
  SHA512:
6
- metadata.gz: 252c4d18a3f3a819429cb76fd1dd53c9aadd3d569f8a3168287371aa910c03383735c5ca12bb89fcc040119f4788ab97bb65a7cd3aa2ec05f5ea7644f947c4f4
7
- data.tar.gz: ad2bb801aff88b3f7f9647ffcea375365c9f279d611e0bc9eb1e4334291b6eef1acdebb2461b6e4b9cc38bb12bb5a3f1514c017e5304ca8f795485c50da059d6
6
+ metadata.gz: bcf221fef615359fe8be1f979cf76ae54e773ef8075c49940989df5c2fd0cc37ee104dcfbf0b2ce441cc80316dd2f10a84d051746def38dd2706f51494314c8f
7
+ data.tar.gz: a5a2fd8e0b9b2374750941656ccd63b3362e159a4cad2df2e00ac8caefd226a9e90d6c54da6b3b7982b61a33ee0dd1d0834872c11fcfc3276913d2550dec926c
data/README.md CHANGED
@@ -21,6 +21,11 @@
21
21
 
22
22
  - [Go to SOULs Document](https://souls.elsoul.nl/)
23
23
 
24
+ <p>
25
+ <a aria-label="SOULs Document" href="https://souls.elsoul.nl/">
26
+ <img src="https://souls.elsoul.nl/imgs/gifs/souls-new-video.gif">
27
+ </a>
28
+ </p>
24
29
 
25
30
  ## What's SOULs?
26
31
 
@@ -33,14 +38,30 @@ Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cl
33
38
  - Maximize development efficiency with CI / CD standard schema-driven Scaffold
34
39
  - Achieve global scale with lower management costs
35
40
 
36
- ![画像](https://souls.elsoul.nl/imgs/docs/SOULs-architecture.jpg)
37
-
41
+ ![SOULs Architecture](https://souls.elsoul.nl/imgs/docs/SOULs-architecture.jpg)
38
42
 
39
43
  SOULs creates 2 types of APP.
40
44
 
41
45
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
42
46
  2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
43
47
 
48
+ ## Ruby type checking
49
+ The SOULs framework uses RBS / Steep, which appeared in Ruby 3.0.
50
+
51
+ - [RBS](https://github.com/ruby/rbs/)
52
+ - [Steep](https://github.com/soutaro/steep/)
53
+
54
+ As a result, typos, column types, etc.
55
+
56
+ It is a development environment where you can immediately notice the mistakes that occur frequently.
57
+
58
+ <p>
59
+ <a aria-label="RBS Demo" href="https://souls.elsoul.nl/ja/docs/guides/basic/type-check/">
60
+ <img src="https://souls.elsoul.nl/imgs/gifs/rbs-video.gif">
61
+ </a>
62
+ </p>
63
+
64
+
44
65
  ## Dependency
45
66
 
46
67
  - [Google SDK](https://cloud.google.com/sdk/docs)
@@ -55,7 +55,6 @@ module Souls
55
55
  system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
56
56
  else
57
57
  system("rake db:migrate:reset")
58
- system("rake db:migrate:reset RACK_ENV=test")
59
58
  end
60
59
  rescue Thor::Error => e
61
60
  raise(Thor::Error, e)
@@ -7,7 +7,11 @@ module Souls
7
7
  create_service_account_key
8
8
  Souls::Gcloud.new.enable_permissions
9
9
  add_permissions
10
- export_key_to_console
10
+ begin
11
+ set_gh_secret_json
12
+ rescue StandardError
13
+ export_key_to_console
14
+ end
11
15
  rescue Thor::Error => e
12
16
  raise(Thor::Error, e)
13
17
  end
@@ -95,5 +99,11 @@ module Souls
95
99
  add_service_account_role(role: role)
96
100
  end
97
101
  end
102
+
103
+ def set_gh_secret_json
104
+ file_path = "config/keyfile.json"
105
+ system("gh secret set GCP_SA_KEY < #{file_path}")
106
+ FileUtils.rm(file_path)
107
+ end
98
108
  end
99
109
  end
@@ -3,15 +3,26 @@ module Souls
3
3
  desc "create_instance", "Create Google Cloud SQL - PostgreSQL13"
4
4
  method_option :region, default: "", aliases: "--region", desc: "Google Cloud Platform Region"
5
5
  method_option :root_password, default: "", aliases: "--root-password", desc: "Set Cloud SQL Root Password"
6
+ method_option :mysql, type: :boolean, default: false, aliases: "--mysql", desc: "Set Cloud SQL Type to MySQL"
6
7
  def create_instance
7
- instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
8
+ instance_name = "souls-#{Souls.configuration.app}-db" if instance_name.blank?
8
9
  region = Souls.configuration.region if options[:region].blank?
10
+ db_type = options[:mysql] ? "MYSQL_8_0" : "POSTGRES_13"
11
+
9
12
  zone = "#{region}-b"
10
13
  system(
11
14
  "gcloud sql instances create #{instance_name} \
12
- --database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} \
15
+ --database-version=#{db_type} --cpu=2 --memory=7680MB --zone=#{zone} \
13
16
  --root-password='#{options[:root_password]}' --database-flags cloudsql.iam_authentication=on"
14
17
  )
18
+ Dir.chdir(Souls.get_api_path.to_s) do
19
+ file_path = ".env"
20
+ lines = File.readlines(".env")
21
+ lines[0] = "DB_HOST=#{get_sql_ip.strip}" << $RS
22
+ lines[1] = "DB_PW=#{options[:root_password]}" << $RS
23
+ lines[2] = "DB_USER=#{instance_name}" << $RS
24
+ File.open(file_path, "w") { |f| f.write(lines.join) }
25
+ end
15
26
  rescue Thor::Error => e
16
27
  raise(Thor::Error, e)
17
28
  end
@@ -94,5 +105,11 @@ module Souls
94
105
  rescue Thor::Error => e
95
106
  raise(Thor::Error, e)
96
107
  end
108
+
109
+ private
110
+
111
+ def get_sql_ip
112
+ `gcloud sql instances list | grep james | awk '{print $5}'`
113
+ end
97
114
  end
98
115
  end
@@ -0,0 +1,15 @@
1
+ module Souls
2
+ class Github < Thor
3
+ desc "secret_set", "Github Secret Set by Github CLI"
4
+ def secret_set
5
+ require("#{Souls.get_api_path}/config/souls")
6
+ file_path = ".env.production"
7
+ File.open(file_path, "r") do |file|
8
+ file.each_line do |line|
9
+ key_and_value = line.split("=")
10
+ system("gh secret set #{key_and_value[0]} -b \"#{key_and_value[1].strip}\"")
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,6 @@
1
1
  require_relative "./console/index"
2
2
  require_relative "./generate/index"
3
+ require_relative "./github/index"
3
4
  require_relative "./update/index"
4
5
  require_relative "./create/index"
5
6
  require_relative "./db/index"
@@ -159,6 +159,7 @@ module Souls
159
159
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
160
160
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Steepfile")
161
161
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/gitignore")
162
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.env.production.sample")
162
163
  system("cd #{app_name} && mv gitignore .gitignore")
163
164
  system("cd #{app_name} && bundle")
164
165
  system("cd #{app_name}/apps/api && bundle")
data/lib/souls/cli.rb CHANGED
@@ -4,6 +4,9 @@ module Souls
4
4
  desc "generate [COMMAND]", "SOULs Generate Commands"
5
5
  subcommand "generate", Generate
6
6
 
7
+ desc "github [COMMAND]", "SOULs Github Commands"
8
+ subcommand "github", Github
9
+
7
10
  desc "update [COMMAND]", "SOULs Update Commands"
8
11
  subcommand "update", Update
9
12
 
@@ -32,6 +35,7 @@ module Souls
32
35
  map "c" => :console
33
36
  map "s" => :server
34
37
  map "g" => :generate
38
+ map "gh" => :github
35
39
  map "t" => :test
36
40
  map "d" => :delete
37
41
  map ["-v", "--v", "--version", "-version"] => :version
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.1.2".freeze
2
+ VERSION = "1.3.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.3.0
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.3.0
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-10-24 00:00:00.000000000 Z
13
+ date: 2021-10-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -197,6 +197,7 @@ files:
197
197
  - lib/souls/cli/generate/rspec_resolver.rb
198
198
  - lib/souls/cli/generate/type.rb
199
199
  - lib/souls/cli/generate/type_rbs.rb
200
+ - lib/souls/cli/github/index.rb
200
201
  - lib/souls/cli/index.rb
201
202
  - lib/souls/cli/init/index.rb
202
203
  - lib/souls/cli/release/index.rb
@@ -230,7 +231,7 @@ metadata:
230
231
  homepage_uri: https://souls.elsoul.nl
231
232
  source_code_uri: https://github.com/elsoul/souls
232
233
  changelog_uri: https://github.com/elsoul/souls
233
- post_install_message:
234
+ post_install_message:
234
235
  rdoc_options: []
235
236
  require_paths:
236
237
  - lib
@@ -246,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
247
  version: '0'
247
248
  requirements: []
248
249
  rubygems_version: 3.2.22
249
- signing_key:
250
+ signing_key:
250
251
  specification_version: 4
251
252
  summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
252
253
  Active Record, RSpec, RuboCop, and Google Cloud.