souls 1.13.8 → 1.14.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/exe/souls +8 -1
- data/lib/souls/cli/create/functions.rb +13 -0
- data/lib/souls/cli/create/template/functions_env_yaml.rb +8 -0
- data/lib/souls/cli/gcloud/functions/index.rb +16 -2
- data/lib/souls/utils/index.rb +9 -2
- 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 +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 307c03a9709bb93fa10b1c01c3aeef9195998851d3911cd82e9caf15bdf681e6
|
4
|
+
data.tar.gz: 73e46b801ed06da8633ba90f26a4614adbc0bcc1421b23eab9fae4b2f46fe978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb923fdc7f81864b921b1c6d02ff39512ed972826281c64e8e93da4232f8c9071b48e6266f0642baec145f66d6bbc377e1c91f6573f6623f5c160d202fb57d9
|
7
|
+
data.tar.gz: 727b4134dc221130f6af878677b0d6ec666748ec319aa03970b2e5093f62c33d549b1f46ca78ed2d83be918b97619a3f385ffb736fe30fafe4ee132921d552bf
|
data/exe/souls
CHANGED
@@ -3,7 +3,14 @@ require "souls"
|
|
3
3
|
require "thor"
|
4
4
|
begin
|
5
5
|
souls_command = ARGV[0]
|
6
|
-
require("
|
6
|
+
require(Souls.get_mother_path.to_s + "/config/souls") unless [
|
7
|
+
"new",
|
8
|
+
"docker",
|
9
|
+
"-v",
|
10
|
+
"help",
|
11
|
+
"",
|
12
|
+
nil
|
13
|
+
].include?(souls_command)
|
7
14
|
rescue StandardError
|
8
15
|
raise(StandardError, "No config! Please make `./config/souls.rb` File!")
|
9
16
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require_relative "./template/functions_app"
|
2
2
|
require_relative "./template/functions_gemfile"
|
3
|
+
require_relative "./template/functions_env_yaml"
|
3
4
|
module Souls
|
4
5
|
class Create < Thor
|
5
6
|
desc "functions", "Create SOULs functions"
|
6
7
|
def functions
|
7
8
|
create_app_file
|
8
9
|
create_gemfile
|
10
|
+
create_env_yaml
|
9
11
|
end
|
10
12
|
|
11
13
|
private
|
@@ -31,5 +33,16 @@ module Souls
|
|
31
33
|
Souls::Painter.create_file(file_path)
|
32
34
|
file_path
|
33
35
|
end
|
36
|
+
|
37
|
+
def create_env_yaml
|
38
|
+
file_dir = "./apps/functions"
|
39
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
40
|
+
file_path = "#{file_dir}/.env.yaml"
|
41
|
+
raise(StandardError, "Already Exist!") if File.exist?(file_path)
|
42
|
+
|
43
|
+
File.write(file_path, Template.functions_env_yaml)
|
44
|
+
Souls::Painter.create_file(file_path)
|
45
|
+
file_path
|
46
|
+
end
|
34
47
|
end
|
35
48
|
end
|
@@ -2,18 +2,32 @@ module Souls
|
|
2
2
|
class Functions < Thor
|
3
3
|
desc "deploy", "Deploy Cloud Functions"
|
4
4
|
def deploy
|
5
|
+
require(Souls.get_mother_path.to_s + "/config/souls")
|
5
6
|
project_id = Souls.configuration.project_id
|
6
|
-
Souls::Gcloud.new.config_set
|
7
7
|
Dir.chdir(Souls.get_functions_path.to_s) do
|
8
8
|
system(
|
9
9
|
"
|
10
10
|
gcloud functions deploy souls_functions --project=#{project_id} \
|
11
|
-
--runtime ruby27 --trigger-http --allow-unauthenticated
|
11
|
+
--runtime ruby27 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml
|
12
12
|
"
|
13
13
|
)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
desc "describe", "Describe SOULs Functions"
|
18
|
+
def describe
|
19
|
+
require(Souls.get_mother_path.to_s + "/config/souls")
|
20
|
+
project_id = Souls.configuration.project_id
|
21
|
+
system("gcloud functions describe souls_functions --project=#{project_id}")
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "url", "Get SOULs Functions URL"
|
25
|
+
def url
|
26
|
+
require(Souls.get_mother_path.to_s + "/config/souls")
|
27
|
+
project_id = Souls.configuration.project_id
|
28
|
+
system("gcloud functions describe souls_functions --project=#{project_id}| grep url")
|
29
|
+
end
|
30
|
+
|
17
31
|
desc "dev", "Check SOULs Functions dev"
|
18
32
|
def dev
|
19
33
|
Dir.chdir(Souls.get_functions_path.to_s) do
|
data/lib/souls/utils/index.rb
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
module Souls
|
2
2
|
module Utils
|
3
3
|
def get_mother_path
|
4
|
-
Dir.pwd
|
4
|
+
current_dir = Dir.pwd
|
5
|
+
file_array = current_dir.split("/")
|
6
|
+
mother_dir_num = file_array.rindex("apps")
|
7
|
+
mother_dir_num ? file_array.each_slice(mother_dir_num).to_a[0].join("/") : current_dir
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_functions_path
|
11
|
+
get_mother_path + "/apps/functions"
|
5
12
|
end
|
6
13
|
|
7
14
|
def get_api_path
|
8
|
-
|
15
|
+
get_mother_path + "/apps/api"
|
9
16
|
end
|
10
17
|
|
11
18
|
def type_check(type)
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.14.3
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.14.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: 1.
|
4
|
+
version: 1.14.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/souls/cli/create/functions.rb
|
178
178
|
- lib/souls/cli/create/index.rb
|
179
179
|
- lib/souls/cli/create/template/functions_app.rb
|
180
|
+
- lib/souls/cli/create/template/functions_env_yaml.rb
|
180
181
|
- lib/souls/cli/create/template/functions_gemfile.rb
|
181
182
|
- lib/souls/cli/db/create_migration.rb
|
182
183
|
- lib/souls/cli/db/create_migration_rbs.rb
|