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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ed9ffbee1c79292d85bde12b686954ecdbcb679f7fdde04324d3152d2cc065d
4
- data.tar.gz: f9a65837d335c25d873b65d3fe6eb08c9335314ced645c8568b3fce233477a41
3
+ metadata.gz: 353e8a4fe18201c1024135462ce148e8d3f6b7afb129d8242b982a057fdd13ac
4
+ data.tar.gz: 78c643f66ec26df009165f9023dd40358fc038dca0e5332ffb31565fe2d8da32
5
5
  SHA512:
6
- metadata.gz: 58d4c85fbb4ce6c74dec22a3cb7f4975045798eb5d014a185888e91ac0ae5985b0adeb2a27a535230bc047afcffa8c7b217aa43c122eb6a7974b7d3ea47fd771
7
- data.tar.gz: 9e9b6d5849d53895bc80b37cf446cb501548689f2a43c0040b04556708194b0305d650d95fac2229761f65139d73a2b556e49f6ab74169a60d9ab13d7a831386
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, :worker_repo, :api_repo, :worker_endpoint, :fixed_gems
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
- @worker_repo = nil
391
- @api_repo = nil
391
+ @github_repo = nil
392
392
  @worker_endpoint = nil
393
393
  @fixed_gems = nil
394
394
  end
@@ -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} \
@@ -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.worker_endpoint = "https://worker.com"
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.api = true
53
- config.worker = false
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.26.10".freeze
2
+ VERSION = "0.27.3".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.6.3
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.6.3
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.26.10
4
+ version: 0.27.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI