souls 0.40.2 → 0.41.2
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/exe/souls +6 -18
- data/lib/souls/cli/gcloud/run/index.rb +1 -1
- data/lib/souls/cli/gcloud/sql/index.rb +12 -0
- data/lib/souls/cli/sync/conf.rb +46 -0
- data/lib/souls/cli/sync/index.rb +1 -0
- data/lib/souls/cli/sync/pubsub.rb +3 -3
- 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
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa53fbf9c79d49d1d58e132b0dee2b5ddc8ea26b6f0c8175e6358080907b53e9
|
4
|
+
data.tar.gz: 0cfca344f041fcd6f41428909dce517b432fd4e4cedb5751a6d10b45c7b8d5e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ec7918fb52d203d9dfb87c1c326f9f90acd83d24055efa824061477b82177030fe7793c25ceaf736f2acbe9a7bb824c5e99400154a36bae3ca38979152cad0
|
7
|
+
data.tar.gz: ee25cb4b3ae05f1af3c4b075678e50c70c1244ea320cd0826503fb15d5f83580c4d9a91a11d7e8dcf8ea25caf8f83d868d2f3dcffe07790939362816960327c7
|
data/exe/souls
CHANGED
@@ -135,24 +135,12 @@ begin
|
|
135
135
|
when "release"
|
136
136
|
Souls::Release.gem_release
|
137
137
|
when "sync"
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
status =
|
142
|
-
|
143
|
-
|
144
|
-
Souls::Sync.model
|
145
|
-
Whirly.status = Paint["API and Workers Models Synced!", :green]
|
146
|
-
end
|
147
|
-
when "pubsub"
|
148
|
-
status = Paint["Syncing PubSub...", :yellow]
|
149
|
-
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
150
|
-
Whirly.status = status
|
151
|
-
Souls::Sync.pubsub
|
152
|
-
Whirly.status = Paint["Workers and Google Cloud PubSub Synced!", :green]
|
153
|
-
end
|
154
|
-
else
|
155
|
-
puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
|
138
|
+
method_name = ARGV[1]
|
139
|
+
status = Paint["Syncing Files...", :yellow]
|
140
|
+
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
141
|
+
Whirly.status = status
|
142
|
+
Souls::Sync.public_send(method_name)
|
143
|
+
Whirly.status = Paint["Synced!", :green]
|
156
144
|
end
|
157
145
|
when "create"
|
158
146
|
service_name = ARGV[1]
|
@@ -10,6 +10,18 @@ module Souls
|
|
10
10
|
--root-password='#{root_pass}' --database-flags cloudsql.iam_authentication=on"
|
11
11
|
)
|
12
12
|
end
|
13
|
+
|
14
|
+
def pathch_instance(instance_name: "")
|
15
|
+
app_name = Souls.configuration.app
|
16
|
+
instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
|
17
|
+
project_id = Souls.configuration.project_id
|
18
|
+
system(
|
19
|
+
"gcloud beta sql instances patch #{instance_name} \
|
20
|
+
--project=#{project_id} \
|
21
|
+
--network=#{app_name} \
|
22
|
+
--no-assign-ip"
|
23
|
+
)
|
24
|
+
end
|
13
25
|
end
|
14
26
|
end
|
15
27
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Souls
|
2
|
+
module Sync
|
3
|
+
class << self
|
4
|
+
def conf
|
5
|
+
update_conf
|
6
|
+
update_conf(strain: "api")
|
7
|
+
end
|
8
|
+
|
9
|
+
def update_conf(strain: "mother")
|
10
|
+
workers = Souls.configuration.workers
|
11
|
+
file_path = strain == "mother" ? "config/souls.rb" : "apps/api/config/souls.rb"
|
12
|
+
new_file_path = "souls.rb"
|
13
|
+
worker_switch = false
|
14
|
+
File.open(new_file_path, "w") do |new_line|
|
15
|
+
File.open(file_path, "r") do |f|
|
16
|
+
f.each_line do |line|
|
17
|
+
worker_switch = true if line.include?("config.workers")
|
18
|
+
next if line.strip == "end"
|
19
|
+
|
20
|
+
new_line.write(line) unless worker_switch
|
21
|
+
|
22
|
+
next unless worker_switch
|
23
|
+
|
24
|
+
new_line.write(" config.workers = [\n")
|
25
|
+
workers.each do |worker|
|
26
|
+
endpoint = Souls::Gcloud::Run.get_endpoint(worker_name: worker[:name])
|
27
|
+
new_line.write(<<-TEXT)
|
28
|
+
{
|
29
|
+
name: "#{worker[:name]}",
|
30
|
+
endpoint: "#{endpoint}/endpoint",
|
31
|
+
port: #{worker[:port]}
|
32
|
+
},
|
33
|
+
TEXT
|
34
|
+
end
|
35
|
+
break
|
36
|
+
end
|
37
|
+
end
|
38
|
+
new_line.write(<<-TEXT)
|
39
|
+
]
|
40
|
+
end
|
41
|
+
TEXT
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/souls/cli/sync/index.rb
CHANGED
@@ -24,10 +24,10 @@ module Souls
|
|
24
24
|
|
25
25
|
workers.each do |key, value|
|
26
26
|
if value == 1
|
27
|
-
create_topic(topic_id: key)
|
28
|
-
create_push_subscription(topic_id: key)
|
27
|
+
create_topic(topic_id: key.to_s)
|
28
|
+
create_push_subscription(topic_id: key.to_s)
|
29
29
|
end
|
30
|
-
delete_topic(topic_id: key) if value == -1
|
30
|
+
delete_topic(topic_id: key.to_s) if value == -1
|
31
31
|
end
|
32
32
|
workers
|
33
33
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.20.2
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.20.2
|
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.41.2
|
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-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/souls/cli/index.rb
|
153
153
|
- lib/souls/cli/release/index.rb
|
154
154
|
- lib/souls/cli/release/release.rb
|
155
|
+
- lib/souls/cli/sync/conf.rb
|
155
156
|
- lib/souls/cli/sync/index.rb
|
156
157
|
- lib/souls/cli/sync/model.rb
|
157
158
|
- lib/souls/cli/sync/pubsub.rb
|