souls 0.26.10 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ed9ffbee1c79292d85bde12b686954ecdbcb679f7fdde04324d3152d2cc065d
4
- data.tar.gz: f9a65837d335c25d873b65d3fe6eb08c9335314ced645c8568b3fce233477a41
3
+ metadata.gz: 0c9fa990d327564396a323f48715af865bfdd1e825cbf2538dbb3318675c08aa
4
+ data.tar.gz: b403de454c2c6bc8619201a36af1e7d80ece07e6561fc149e32cd4821e20b021
5
5
  SHA512:
6
- metadata.gz: 58d4c85fbb4ce6c74dec22a3cb7f4975045798eb5d014a185888e91ac0ae5985b0adeb2a27a535230bc047afcffa8c7b217aa43c122eb6a7974b7d3ea47fd771
7
- data.tar.gz: 9e9b6d5849d53895bc80b37cf446cb501548689f2a43c0040b04556708194b0305d650d95fac2229761f65139d73a2b556e49f6ab74169a60d9ab13d7a831386
6
+ metadata.gz: c395c5b01a546475640257ac32f05fe3f59f4a8a4c42a040f1ef3cf9543b082fe9b9b5e2f9ba094dd683e9f30d59c15b7e1e73ac27231c56b65f1814cf052b9a
7
+ data.tar.gz: 50edef7da97873ec4a2521051f3bcb77e8bef07bd63e25ef53052379eacc83bf8adc96eb6dcf4167ad1a243e7fb2a2f78512828d3d5620ebe22b208a39a65976
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}/#{app_name}/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
@@ -93,6 +93,7 @@ module Souls
93
93
  system("curl -OL #{url}")
94
94
  system("mkdir -p #{app_name}/apps/#{service_name}")
95
95
  system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
96
+ system("curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml #{app_name}")
96
97
  FileUtils.rm(file_name)
97
98
  end
98
99
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.26.10".freeze
2
+ VERSION = "0.27.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.6.0
@@ -1 +1 @@
1
- 0.5.10
1
+ 0.6.0
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI