souls 1.13.7 → 1.13.8

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: 3fc7f40511ec0965a0719e497483a38260310725555a29d0898a9cebc0ed2e1d
4
- data.tar.gz: 631eb79cda3828b4bdfa87631a5135433c984c2a50a6afc9bbca5b7a23631746
3
+ metadata.gz: 72b7296bab23e98fd9b93903438de51f974d3c6b5e259ac33507482709a2d42f
4
+ data.tar.gz: 3bc159dcedd469188c6dae391e33e66457967f028459ee409d98bacb29213ac9
5
5
  SHA512:
6
- metadata.gz: 813388aae1bfd538bb2546a3e83c471a1b40ca53ff25ba873ed70bb4775695481055e9da0eed6f5f786051aff32adb4423ee333e9ada7e41a0d0414b8d2cc30a
7
- data.tar.gz: d7aaf5a388ccb022b6c2e4bc076146d23da566bac28b2276c0e1a5d9899464905e6dc9825cf2ee5ee678b73db1b0885698e4caef6dc777e91fb3947dd778c64f
6
+ metadata.gz: cdf23e5b33d20ddb69e9f8c53df6500477114f098a76d7815378f0a4c5ed7c9f8154a6fdface501449eb3af8d9d2af1510250af20717ab912cb89feb0839cfc8
7
+ data.tar.gz: 3a501236dc84b6b7156603a9e4b65a0c7afdc13048c4b1d42b8f27dcfe266198bc801e9ec1cbe58ced9f90b2842bb1d0b233879b4b7e9a30b9aa5361f47203b2
@@ -0,0 +1,35 @@
1
+ require_relative "./template/functions_app"
2
+ require_relative "./template/functions_gemfile"
3
+ module Souls
4
+ class Create < Thor
5
+ desc "functions", "Create SOULs functions"
6
+ def functions
7
+ create_app_file
8
+ create_gemfile
9
+ end
10
+
11
+ private
12
+
13
+ def create_app_file
14
+ file_dir = "./apps/functions"
15
+ FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
16
+ file_path = "#{file_dir}/app.rb"
17
+ raise(StandardError, "Already Exist!") if File.exist?(file_path)
18
+
19
+ File.write(file_path, Template.functions_app)
20
+ Souls::Painter.create_file(file_path)
21
+ file_path
22
+ end
23
+
24
+ def create_gemfile
25
+ file_dir = "./apps/functions"
26
+ FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
27
+ file_path = "#{file_dir}/Gemfile"
28
+ raise(StandardError, "Already Exist!") if File.exist?(file_path)
29
+
30
+ File.write(file_path, Template.functions_gemfile)
31
+ Souls::Painter.create_file(file_path)
32
+ file_path
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,4 @@
1
+ require_relative "./functions"
1
2
  module Souls
2
3
  class Create < Thor
3
4
  desc "worker", "Create SOULs Worker"
@@ -0,0 +1,24 @@
1
+ module Template
2
+ def self.functions_app
3
+ <<~APP
4
+ require "functions_framework"
5
+ require "sinatra/base"
6
+ require "dotenv/load"
7
+
8
+ class App < Sinatra::Base
9
+ get "/souls-functions-get/:name" do
10
+ "SOULs Functions Job Done! - \#{params['name']}"
11
+ end
12
+
13
+ post "/souls-functions-post" do
14
+ params = JSON.parse(request.body.read)
15
+ "SOULs Functions Job Done! - \#{params['name']}"
16
+ end
17
+ end
18
+
19
+ FunctionsFramework.http("souls_functions") do |request|
20
+ App.call(request.env)
21
+ end
22
+ APP
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ module Template
2
+ def self.functions_gemfile
3
+ <<~GEMFILE
4
+ source "https://rubygems.org"
5
+
6
+ gem "dotenv", "2.7.6"
7
+ gem "functions_framework", "~> 0.7"
8
+ gem "sinatra", "2.1.0"
9
+
10
+ GEMFILE
11
+ end
12
+ end
@@ -0,0 +1,24 @@
1
+ module Souls
2
+ class Functions < Thor
3
+ desc "deploy", "Deploy Cloud Functions"
4
+ def deploy
5
+ project_id = Souls.configuration.project_id
6
+ Souls::Gcloud.new.config_set
7
+ Dir.chdir(Souls.get_functions_path.to_s) do
8
+ system(
9
+ "
10
+ gcloud functions deploy souls_functions --project=#{project_id} \
11
+ --runtime ruby27 --trigger-http --allow-unauthenticated
12
+ "
13
+ )
14
+ end
15
+ end
16
+
17
+ desc "dev", "Check SOULs Functions dev"
18
+ def dev
19
+ Dir.chdir(Souls.get_functions_path.to_s) do
20
+ system("bundle exec functions-framework-ruby --target souls_functions")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -4,6 +4,7 @@ require_relative "./run/index"
4
4
  require_relative "./sql/index"
5
5
  require_relative "./compute/index"
6
6
  require_relative "./scheduler/index"
7
+ require_relative "./functions/index"
7
8
  require_relative "../cli_exception"
8
9
 
9
10
  module Souls
@@ -26,6 +27,9 @@ module Souls
26
27
  desc "scheduler [COMMAND]", "souls gcloud schedluer Commands"
27
28
  subcommand "scheduler", CloudScheduler
28
29
 
30
+ desc "functions [COMMAND]", "souls gcloud functions Commands"
31
+ subcommand "functions", Functions
32
+
29
33
  map run: "cloud_run"
30
34
 
31
35
  desc "auth_login", "gcloud config set and gcloud auth login"
data/lib/souls/cli.rb CHANGED
@@ -31,6 +31,9 @@ module Souls
31
31
  desc "upgrade [COMMAND]", "SOULs Upgrade Commands"
32
32
  subcommand "upgrade", Upgrade
33
33
 
34
+ desc "functions [COMMAND]", "SOULs functions Commands"
35
+ subcommand "functions", Functions
36
+
34
37
  # rubocop:disable Style/StringHashKeys
35
38
  map "c" => :console
36
39
  map "s" => :server
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.13.7".freeze
2
+ VERSION = "1.13.8".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.13.7
1
+ 1.13.8
@@ -1 +1 @@
1
- 1.13.7
1
+ 1.13.8
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: 1.13.7
4
+ version: 1.13.8
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-12-22 00:00:00.000000000 Z
13
+ date: 2021-12-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -174,7 +174,10 @@ files:
174
174
  - lib/souls/cli.rb
175
175
  - lib/souls/cli/cli_exception.rb
176
176
  - lib/souls/cli/console/index.rb
177
+ - lib/souls/cli/create/functions.rb
177
178
  - lib/souls/cli/create/index.rb
179
+ - lib/souls/cli/create/template/functions_app.rb
180
+ - lib/souls/cli/create/template/functions_gemfile.rb
178
181
  - lib/souls/cli/db/create_migration.rb
179
182
  - lib/souls/cli/db/create_migration_rbs.rb
180
183
  - lib/souls/cli/db/index.rb
@@ -208,6 +211,7 @@ files:
208
211
  - lib/souls/cli/delete/type_rbs.rb
209
212
  - lib/souls/cli/docker/index.rb
210
213
  - lib/souls/cli/gcloud/compute/index.rb
214
+ - lib/souls/cli/gcloud/functions/index.rb
211
215
  - lib/souls/cli/gcloud/iam/index.rb
212
216
  - lib/souls/cli/gcloud/index.rb
213
217
  - lib/souls/cli/gcloud/pubsub/index.rb