souls 0.26.10 → 0.27.3
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/lib/souls.rb +3 -3
- data/lib/souls/gcloud/iam.rb +35 -0
- data/lib/souls/gcloud/methods.rb +7 -0
- data/lib/souls/init.rb +5 -5
- 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 +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 353e8a4fe18201c1024135462ce148e8d3f6b7afb129d8242b982a057fdd13ac
|
4
|
+
data.tar.gz: 78c643f66ec26df009165f9023dd40358fc038dca0e5332ffb31565fe2d8da32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 352fb81529ed91ca46c3f4fd9f480e2bc69369ece9f71ca9ebd6441e9f0c737578076eb8b6001f2402dac74c93e8413452f57fd3bd390d148e0318cc53cf26b3
|
7
|
+
data.tar.gz: 2a6cd2042230b8a2cce4bb5cf4008d96d28cd94cb1e0f44ca1c92c4104526635f2e2a6fe316dfe12a9d9cc4c2a80206b8c79afcff4a0a8377b876d1cc5d490b3
|
data/lib/souls.rb
CHANGED
@@ -192,6 +192,7 @@ module Souls
|
|
192
192
|
|
193
193
|
system("gsutil cp #{service_name}.tgz #{bucket_url}/#{service_name.pluralize}/#{file_name}")
|
194
194
|
system("gsutil cp #{service_name}.tgz #{bucket_url}/#{service_name.pluralize}/#{release_name}")
|
195
|
+
system("gsutil cp .rubocop.yml #{bucket_url}/.rubocop.yml")
|
195
196
|
FileUtils.rm("#{service_name}.tgz")
|
196
197
|
"#{service_name}-v#{new_ver} Succefully Stored to GCS! "
|
197
198
|
end
|
@@ -381,14 +382,13 @@ module Souls
|
|
381
382
|
end
|
382
383
|
|
383
384
|
class Configuration
|
384
|
-
attr_accessor :app, :strain, :project_id, :
|
385
|
+
attr_accessor :app, :strain, :project_id, :github_repo, :worker_endpoint, :fixed_gems
|
385
386
|
|
386
387
|
def initialize
|
387
388
|
@app = nil
|
388
389
|
@project_id = nil
|
389
390
|
@strain = nil
|
390
|
-
@
|
391
|
-
@api_repo = nil
|
391
|
+
@github_repo = nil
|
392
392
|
@worker_endpoint = nil
|
393
393
|
@fixed_gems = nil
|
394
394
|
end
|
data/lib/souls/gcloud/iam.rb
CHANGED
@@ -16,6 +16,41 @@ module Souls
|
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
19
|
+
def export_key_to_console
|
20
|
+
github_repo = Souls.configuration.github_repo || "elsoul/souls"
|
21
|
+
file_path = "config/keyfile.json"
|
22
|
+
puts(Paint["======= below(ここから)=======", :cyan])
|
23
|
+
text = []
|
24
|
+
File.open(file_path, "r") do |line|
|
25
|
+
line.each_line do |l|
|
26
|
+
text << l
|
27
|
+
end
|
28
|
+
end
|
29
|
+
key = text.join(",").gsub(/^,/, "").chomp!
|
30
|
+
puts(Paint[key, :white])
|
31
|
+
puts(Paint["======= above(ここまで)=======", :cyan])
|
32
|
+
github_secret_url = "https://github.com/#{github_repo}/settings/secrets/actions"
|
33
|
+
souls_doc_url = "https://souls.elsoul.nl/docs/chapter2/#43-github-シークレットキーの登録"
|
34
|
+
txt1 = <<~TEXT
|
35
|
+
|
36
|
+
⬆⬆⬆ Copy the service account key above ⬆⬆⬆⬆
|
37
|
+
|
38
|
+
And
|
39
|
+
|
40
|
+
Go to %{yellow_text}
|
41
|
+
|
42
|
+
Reference: %{yellow_text2}
|
43
|
+
TEXT
|
44
|
+
puts(
|
45
|
+
Paint % [
|
46
|
+
txt1,
|
47
|
+
:white,
|
48
|
+
{ yellow_text: [github_secret_url, :yellow], yellow_text2: [souls_doc_url, :yellow] }
|
49
|
+
]
|
50
|
+
)
|
51
|
+
fileutils.rm(file_path)
|
52
|
+
end
|
53
|
+
|
19
54
|
def add_service_account_role(service_account: "souls-app", project_id: "souls-app", role: "roles/firebase.admin")
|
20
55
|
system(
|
21
56
|
"gcloud projects add-iam-policy-binding #{project_id} \
|
data/lib/souls/gcloud/methods.rb
CHANGED
@@ -4,6 +4,13 @@ module Souls
|
|
4
4
|
def return_method(args)
|
5
5
|
method = args[1]
|
6
6
|
case method
|
7
|
+
when "get_iam_key"
|
8
|
+
app_name = Souls.configuration.app
|
9
|
+
project_id = Souls.configuration.project_id
|
10
|
+
Souls::Gcloud.create_service_account(service_account: app_name)
|
11
|
+
Souls::Gcloud.create_service_account_key(service_account: app_name, project_id: project_id)
|
12
|
+
Souls::Gcloud.export_key_to_console
|
13
|
+
Souls::Gcloud.enable_permissions
|
7
14
|
when "auth_login"
|
8
15
|
project_id = Souls.configuration.project_id
|
9
16
|
Souls::Gcloud.auth_login(project_id: project_id)
|
data/lib/souls/init.rb
CHANGED
@@ -20,7 +20,8 @@ module Souls
|
|
20
20
|
config.app = "#{app_name}"
|
21
21
|
config.project_id = "souls-app"
|
22
22
|
config.strain = "#{service_name}"
|
23
|
-
config.
|
23
|
+
config.github_repo = "elsoul/souls"
|
24
|
+
config.worker_endpoint = "https://worker.test.com"
|
24
25
|
config.fixed_gems = ["excluded_gem"]
|
25
26
|
end
|
26
27
|
TEXT
|
@@ -49,10 +50,8 @@ module Souls
|
|
49
50
|
config.app = "#{app_name}"
|
50
51
|
config.project_id = "souls-app"
|
51
52
|
config.strain = "mother"
|
52
|
-
config.
|
53
|
-
config.
|
54
|
-
config.frontend = false
|
55
|
-
config.worker_endpoint = ""
|
53
|
+
config.github_repo = "elsoul/souls"
|
54
|
+
config.worker_endpoint = "https://worker.test.com"
|
56
55
|
config.fixed_gems = ["excluded_gem"]
|
57
56
|
end
|
58
57
|
TEXT
|
@@ -93,6 +92,7 @@ module Souls
|
|
93
92
|
system("curl -OL #{url}")
|
94
93
|
system("mkdir -p #{app_name}/apps/#{service_name}")
|
95
94
|
system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
|
95
|
+
system("curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml #{app_name}")
|
96
96
|
FileUtils.rm(file_name)
|
97
97
|
end
|
98
98
|
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.3
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.3
|