souls 0.53.2 → 0.54.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/README.md +3 -10
- data/lib/souls/api/generate/application.rb +4 -2
- data/lib/souls/api/index.rb +1 -1
- data/lib/souls/cli/create/index.rb +1 -0
- data/lib/souls/cli/db/index.rb +1 -0
- data/lib/souls/cli/gcloud/index.rb +6 -0
- data/lib/souls/cli/gcloud/run/index.rb +6 -3
- data/lib/souls/cli/sync/conf.rb +2 -1
- data/lib/souls/cli/sync/pubsub.rb +14 -4
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- data/lib/souls/worker/index.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03e2a30c13d2d7dade4f9d5dd6a7ba08c6812c18bcb6f96520dc4f2a61018f80
|
4
|
+
data.tar.gz: 8a03989b99ed64d76ac4a3c7d2dbc170660d1ea417058249cf22bd60bd8dc9d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be5fc71729fa8921edbb79ca27d4698598ae399690e28cf287955355c9965e90d961a2ff532a8b81996177f22286fd689e8d13a9dff10d82a04ccee1b2e2ba68
|
7
|
+
data.tar.gz: 809ebfa9484852965896d3e0bfc7731abd005b6d3ced814335be755917c3de4a9f5053d8b664cad14b4fa242e7f46c34fa25a348f1bf431398135ced5f829c8e
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![SOULs](https://
|
1
|
+
[![SOULs](https://souls.elsoul.nl/ogp.jpg)](https://souls.elsoul.nl)
|
2
2
|
|
3
3
|
<p align="center">
|
4
4
|
<a aria-label="Ruby logo" href="https://el-soul.com">
|
@@ -27,7 +27,7 @@ SOULs はサーバーレスフルスタックフレームワークです。柔
|
|
27
27
|
SOULs バックエンドには `API` と `Worker` の 2 つのタイプがあります。
|
28
28
|
`API` は主にデータをフロントエンドへ提供します。`Worker` は主に `タスク` の処理を行います
|
29
29
|
|
30
|
-
![画像](https://
|
30
|
+
![画像](https://souls.elsoul.nl/imgs/docs/SOULs.jpg)
|
31
31
|
|
32
32
|
現在のバージョンでは SOULs `API` と `Worker` を Github Actions を使って Google Cloud Run へそれぞれデプロイします。
|
33
33
|
|
@@ -86,8 +86,6 @@ Check your GraphQL PlayGround
|
|
86
86
|
|
87
87
|
(localhost:4000/playground)[localhost:4000/playground]
|
88
88
|
|
89
|
-
|
90
|
-
|
91
89
|
## Gemfile 自動更新アップデート
|
92
90
|
|
93
91
|
`Gemfile`, `Gemfile.lock` を最新のバージョンに自動更新します。
|
@@ -96,11 +94,9 @@ Check your GraphQL PlayGround
|
|
96
94
|
souls upgrade gemfile
|
97
95
|
```
|
98
96
|
|
99
|
-
|
100
97
|
除外したい `gem` は `config/souls.rb` 内の
|
101
98
|
`config.fixed_gems` の配列に追加します。
|
102
99
|
|
103
|
-
|
104
100
|
```ruby
|
105
101
|
Souls.configure do |config|
|
106
102
|
config.app = "souls-api"
|
@@ -113,15 +109,12 @@ Souls.configure do |config|
|
|
113
109
|
end
|
114
110
|
```
|
115
111
|
|
116
|
-
|
117
|
-
|
118
112
|
## SOULs Serverless Application Framework Document
|
119
113
|
|
120
114
|
SOULs サーバーレスアプリケーションフレームワーク
|
121
115
|
ドキュメントはこちらから
|
122
|
-
- [SOULs Document](https://souls.elsoul.nl/)
|
123
|
-
|
124
116
|
|
117
|
+
- [SOULs Document](https://souls.elsoul.nl/)
|
125
118
|
|
126
119
|
## Development
|
127
120
|
|
@@ -17,6 +17,7 @@ module Souls
|
|
17
17
|
mutation(singularized_class_name)
|
18
18
|
policy(singularized_class_name)
|
19
19
|
rspec_policy(singularized_class_name)
|
20
|
+
true
|
20
21
|
rescue Thor::Error => e
|
21
22
|
raise(Thor::Error, e)
|
22
23
|
end
|
@@ -25,15 +26,16 @@ module Souls
|
|
25
26
|
def scaffold_all
|
26
27
|
puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
|
27
28
|
Souls.get_tables.each do |table|
|
28
|
-
Souls::
|
29
|
+
Souls::Generate.new.scaffold(table.singularize)
|
29
30
|
puts(Paint["Generated #{table.camelize} CRUD Files\n", :yellow])
|
30
31
|
end
|
32
|
+
true
|
31
33
|
rescue Thor::Error => e
|
32
34
|
raise(Thor::Error, e)
|
33
35
|
end
|
34
36
|
|
35
37
|
desc "delete_all [CLASS_NAME]", "Generate Scaffold All Tables from schema.rb"
|
36
|
-
def delete_all(class_name
|
38
|
+
def delete_all(class_name)
|
37
39
|
singularized_class_name = class_name.singularize.underscore
|
38
40
|
pluralized_class_name = class_name.pluralize.underscore
|
39
41
|
FileUtils.rm("./app/models/#{singularized_class_name}.rb")
|
data/lib/souls/api/index.rb
CHANGED
data/lib/souls/cli/db/index.rb
CHANGED
@@ -32,6 +32,12 @@ module Souls
|
|
32
32
|
raise(Thor::Error, e)
|
33
33
|
end
|
34
34
|
|
35
|
+
desc "config_set", "gcloud config set"
|
36
|
+
def config_set
|
37
|
+
project_id = Souls.configuration.project_id
|
38
|
+
system("gcloud config set project #{project_id}")
|
39
|
+
end
|
40
|
+
|
35
41
|
desc "enable_permissions", "Enable Google Cloud APIs for SOULs Framework"
|
36
42
|
def enable_permissions
|
37
43
|
system("gcloud services enable compute.googleapis.com")
|
@@ -13,8 +13,8 @@ module Souls
|
|
13
13
|
end
|
14
14
|
|
15
15
|
desc "list", "Show Google Cloud Run List"
|
16
|
-
def list
|
17
|
-
project_id = Souls.configuration.project_id
|
16
|
+
def list
|
17
|
+
project_id = Souls.configuration.project_id
|
18
18
|
system("gcloud run services list --project #{project_id} --platform managed")
|
19
19
|
rescue Thor::Error => e
|
20
20
|
raise(Thor::Error, e)
|
@@ -22,7 +22,10 @@ module Souls
|
|
22
22
|
|
23
23
|
desc "get_endpoint", "Show Worker's Endpoint"
|
24
24
|
def get_endpoint(worker_name: "")
|
25
|
-
|
25
|
+
app_name = Souls.configuration.app
|
26
|
+
project_id = Souls.configuration.project_id
|
27
|
+
`gcloud run services list --project #{project_id}
|
28
|
+
--platform managed | grep #{app_name}-souls-#{worker_name} | awk '{print $4}'`
|
26
29
|
rescue Thor::Error => e
|
27
30
|
raise(Thor::Error, e)
|
28
31
|
end
|
data/lib/souls/cli/sync/conf.rb
CHANGED
@@ -2,6 +2,7 @@ module Souls
|
|
2
2
|
class Sync < Thor
|
3
3
|
desc "conf", "Sync config/souls.rb Endpoint with Google Cloud Run"
|
4
4
|
def conf
|
5
|
+
Souls::Gcloud.new.config_set
|
5
6
|
update_conf
|
6
7
|
update_conf(strain: "api")
|
7
8
|
puts(
|
@@ -36,7 +37,7 @@ module Souls
|
|
36
37
|
|
37
38
|
new_line.write(" config.workers = [\n")
|
38
39
|
workers.each_with_index do |worker, i|
|
39
|
-
base_url = Souls::
|
40
|
+
base_url = Souls::CloudRun.new.get_endpoint(worker_name: worker[:name])
|
40
41
|
endpoint = Souls.configuration.endpoint
|
41
42
|
if (i + 1) == workers.size
|
42
43
|
new_line.write(<<-TEXT)
|
@@ -2,6 +2,7 @@ module Souls
|
|
2
2
|
class Sync < Thor
|
3
3
|
desc "pubsub", "Sync Worker Jobs & Google Cloud Pubsub Subscriptions"
|
4
4
|
def pubsub
|
5
|
+
Souls::Gcloud.new.config_set
|
5
6
|
get_topics(workers: get_workers)
|
6
7
|
puts(Paint["All Jobs Synced with PubSub Subscription!", :green])
|
7
8
|
rescue Thor::Error => e
|
@@ -11,6 +12,7 @@ module Souls
|
|
11
12
|
private
|
12
13
|
|
13
14
|
def get_topics(workers: {})
|
15
|
+
app_name = Souls.configuration.app
|
14
16
|
project_id = Souls.configuration.project_id
|
15
17
|
pubsub = Google::Cloud::Pubsub.new
|
16
18
|
topics = pubsub.topics
|
@@ -20,6 +22,8 @@ module Souls
|
|
20
22
|
topic.name.gsub("projects/#{project_id}/topics/", "")
|
21
23
|
end
|
22
24
|
|
25
|
+
topic_names.select { |n| n.include?("#{app_name}_souls_") }
|
26
|
+
|
23
27
|
topic_names.each do |name|
|
24
28
|
value = workers[name.to_sym] || 0
|
25
29
|
workers[name.to_sym] = value - 1
|
@@ -36,23 +40,29 @@ module Souls
|
|
36
40
|
end
|
37
41
|
|
38
42
|
def create_topic(topic_id: "mailer")
|
43
|
+
app_name = Souls.configuration.app
|
39
44
|
pubsub = Google::Cloud::Pubsub.new
|
40
|
-
|
45
|
+
topic_name = "#{app_name}_souls_#{topic_id}"
|
46
|
+
topic = pubsub.create_topic(topic_name.to_s)
|
41
47
|
puts("Topic #{topic.name} created.")
|
42
48
|
end
|
43
49
|
|
44
50
|
def delete_topic(topic_id: "mailer")
|
51
|
+
app_name = Souls.configuration.app
|
45
52
|
pubsub = Google::Cloud::Pubsub.new
|
46
|
-
|
53
|
+
topic_name = "#{app_name}_souls_#{topic_id}"
|
54
|
+
topic = pubsub.topic(topic_name.to_s)
|
47
55
|
topic.delete
|
48
|
-
puts("Topic #{
|
56
|
+
puts("Topic #{topic_name} deleted.")
|
49
57
|
end
|
50
58
|
|
51
59
|
def create_push_subscription(topic_id: "mailer")
|
52
60
|
require("#{Souls.get_mother_path}/config/souls")
|
53
61
|
worker_name = topic_id.split("_")[0]
|
62
|
+
app_name = Souls.configuration.app
|
63
|
+
topic_name = "#{app_name}_souls_#{topic_id}"
|
54
64
|
|
55
|
-
subscription_id = "#{
|
65
|
+
subscription_id = "#{topic_name}_sub"
|
56
66
|
endpoint = ""
|
57
67
|
worker_paths = Souls.configuration.workers
|
58
68
|
worker_paths.each do |worker|
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.33.0
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.33.0
|
data/lib/souls/worker/index.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-09-
|
13
|
+
date: 2021-09-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|