souls 1.12.5 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/souls/app/index.rb +1 -0
- data/lib/souls/app/utils/painter.rb +33 -0
- data/lib/souls/cli/create/index.rb +14 -12
- data/lib/souls/cli/db/create_migration_rbs.rb +1 -1
- data/lib/souls/cli/db/index.rb +1 -0
- data/lib/souls/cli/db/model.rb +1 -1
- data/lib/souls/cli/db/model_rbs.rb +1 -1
- data/lib/souls/cli/db/rspec_model.rb +1 -1
- data/lib/souls/cli/delete/connection_rbs.rb +1 -1
- data/lib/souls/cli/delete/edge.rb +1 -1
- data/lib/souls/cli/delete/job.rb +1 -1
- data/lib/souls/cli/delete/job_rbs.rb +1 -1
- data/lib/souls/cli/delete/manager.rb +1 -1
- data/lib/souls/cli/delete/manager_rbs.rb +1 -1
- data/lib/souls/cli/delete/migration_file.rb +24 -0
- data/lib/souls/cli/delete/mutation.rb +1 -1
- data/lib/souls/cli/delete/mutation_rbs.rb +1 -1
- data/lib/souls/cli/delete/query.rb +1 -1
- data/lib/souls/cli/delete/query_rbs.rb +1 -1
- data/lib/souls/cli/delete/resolver.rb +1 -1
- data/lib/souls/cli/delete/resolver_rbs.rb +1 -1
- data/lib/souls/cli/delete/rspec_factory.rb +1 -1
- data/lib/souls/cli/delete/rspec_job.rb +1 -1
- data/lib/souls/cli/delete/rspec_manager.rb +1 -1
- data/lib/souls/cli/delete/rspec_mutation.rb +1 -1
- data/lib/souls/cli/delete/rspec_query.rb +1 -1
- data/lib/souls/cli/delete/rspec_resolver.rb +1 -1
- data/lib/souls/cli/delete/type.rb +1 -1
- data/lib/souls/cli/delete/type_rbs.rb +1 -1
- data/lib/souls/cli/gcloud/compute/index.rb +2 -2
- data/lib/souls/cli/gcloud/sql/index.rb +45 -37
- data/lib/souls/cli/generate/connection.rb +1 -1
- data/lib/souls/cli/generate/connection_rbs.rb +1 -1
- data/lib/souls/cli/generate/edge.rb +1 -1
- data/lib/souls/cli/generate/edge_rbs.rb +2 -2
- data/lib/souls/cli/generate/job.rb +4 -4
- data/lib/souls/cli/generate/job_rbs.rb +1 -1
- data/lib/souls/cli/generate/manager.rb +1 -1
- data/lib/souls/cli/generate/manager_rbs.rb +2 -2
- data/lib/souls/cli/generate/mutation.rb +4 -4
- data/lib/souls/cli/generate/mutation_rbs.rb +4 -4
- data/lib/souls/cli/generate/query.rb +2 -2
- data/lib/souls/cli/generate/query_rbs.rb +2 -2
- data/lib/souls/cli/generate/resolver.rb +1 -1
- data/lib/souls/cli/generate/resolver_rbs.rb +2 -2
- data/lib/souls/cli/generate/rspec_factory.rb +1 -1
- data/lib/souls/cli/generate/rspec_job.rb +1 -1
- data/lib/souls/cli/generate/rspec_manager.rb +1 -1
- data/lib/souls/cli/generate/rspec_mutation.rb +1 -1
- data/lib/souls/cli/generate/rspec_query.rb +1 -1
- data/lib/souls/cli/generate/rspec_resolver.rb +1 -1
- data/lib/souls/cli/generate/type.rb +1 -1
- data/lib/souls/cli/generate/type_rbs.rb +1 -1
- data/lib/souls/cli/github/index.rb +10 -7
- data/lib/souls/cli/release/release.rb +1 -1
- data/lib/souls/cli/sync/conf.rb +5 -7
- data/lib/souls/cli/sync/model.rb +1 -1
- data/lib/souls/cli/sync/pubsub.rb +1 -1
- data/lib/souls/cli/update/mutation.rb +6 -10
- data/lib/souls/cli/update/mutation_rbs.rb +2 -2
- data/lib/souls/cli/update/resolver.rb +1 -1
- data/lib/souls/cli/update/rspec_factory.rb +1 -1
- data/lib/souls/cli/update/rspec_mutation.rb +1 -1
- data/lib/souls/cli/update/rspec_resolver.rb +1 -1
- data/lib/souls/cli/update/type.rb +1 -1
- data/lib/souls/cli/update/type_rbs.rb +1 -1
- 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 +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f2379099a16dfdc0ae7b5e49cf8cb1cb15e75c2542e8b2a60083949b72308dd
|
4
|
+
data.tar.gz: 75f87b3b1b6223364ca964190c44a09856f629dfbdfcb952d7a1c61064a1709a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd51f504d1f187379daf97e9878801463a37ee83155137b7d57bc9f12036c628eb64e69863b0e0e0d0848bd090f25a3af00534f7bcdea59d202232f28cd1f591
|
7
|
+
data.tar.gz: 6554f9f8ff01dd5e320c5283c202765f970a5ae74461b18606b27c7acfe2b57e75257315838a4409ea7bf334c2bc98216c76c909afa25205a36b5b11104c31c6
|
data/lib/souls/app/index.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative "graphql/souls_mutation"
|
|
2
2
|
require_relative "graphql/souls_query"
|
3
3
|
require_relative "graphql/souls_connection"
|
4
4
|
require_relative "utils/souls_logger"
|
5
|
+
require_relative "utils/painter"
|
5
6
|
require_relative "utils/firebase_id_token"
|
6
7
|
require_relative "graphql/types/index"
|
7
8
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Souls
|
2
|
+
module Painter
|
3
|
+
class << self
|
4
|
+
def create_file(text)
|
5
|
+
puts(Paint % ["✓ %{white_text}", :green, { white_text: ["Created file #{text}", :white] }])
|
6
|
+
end
|
7
|
+
|
8
|
+
def update_file(text)
|
9
|
+
puts(Paint % ["✓ %{white_text}", :yellow, { white_text: ["Updated file #{text}", :white] }])
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete_file(text)
|
13
|
+
puts(Paint % ["✓ %{white_text}", :red, { white_text: ["Deleted file #{text}", :white] }])
|
14
|
+
end
|
15
|
+
|
16
|
+
def error(text)
|
17
|
+
puts(Paint["🚨 #{text}", :red])
|
18
|
+
end
|
19
|
+
|
20
|
+
def warning(text)
|
21
|
+
puts(Paint["🚨 #{text}", :yellow])
|
22
|
+
end
|
23
|
+
|
24
|
+
def success(text)
|
25
|
+
puts(Paint["🎉 #{text}", :green])
|
26
|
+
end
|
27
|
+
|
28
|
+
def sync(text)
|
29
|
+
puts(Paint % ["✓ %{white_text}", :blue, { white_text: ["Synced #{text}", :white] }])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -145,11 +145,24 @@ end
|
|
145
145
|
uses: ruby/setup-ruby@v1
|
146
146
|
with:
|
147
147
|
ruby-version: 3.0
|
148
|
+
|
149
|
+
- name: Checkout the repository
|
150
|
+
uses: actions/checkout@v2
|
151
|
+
|
152
|
+
- name: GCP Authenticate
|
153
|
+
uses: google-github-actions/setup-gcloud@master
|
154
|
+
with:
|
155
|
+
version: "323.0.0"
|
156
|
+
project_id: ${{ secrets.SOULS_GCP_PROJECT_ID }}
|
157
|
+
service_account_key: ${{ secrets.SOULS_GCP_SA_KEY }}
|
158
|
+
export_default_credentials: true
|
159
|
+
|
148
160
|
- name: Build and test with Rake
|
149
161
|
env:
|
150
162
|
PGHOST: 127.0.0.1
|
151
163
|
PGUSER: postgres
|
152
164
|
RACK_ENV: test
|
165
|
+
SOULS_GCP_PROJECT_ID: ${{ secrets.SOULS_GCP_PROJECT_ID }}
|
153
166
|
run: |
|
154
167
|
sudo apt-get -yqq install libpq-dev
|
155
168
|
cd apps/#{worker_name}
|
@@ -159,17 +172,6 @@ end
|
|
159
172
|
bundle exec rake db:migrate RACK_ENV=test
|
160
173
|
bundle exec rspec
|
161
174
|
|
162
|
-
- name: Checkout the repository
|
163
|
-
uses: actions/checkout@v2
|
164
|
-
|
165
|
-
- name: GCP Authenticate
|
166
|
-
uses: google-github-actions/setup-gcloud@master
|
167
|
-
with:
|
168
|
-
version: "323.0.0"
|
169
|
-
project_id: ${{ secrets.SOULS_GCP_PROJECT_ID }}
|
170
|
-
service_account_key: ${{ secrets.SOULS_GCP_SA_KEY }}
|
171
|
-
export_default_credentials: true
|
172
|
-
|
173
175
|
- name: Sync Tasks
|
174
176
|
run: cd apps/#{worker_name} && souls gcloud scheduler sync_schedules --timezone=${{ secrets.TZ }}
|
175
177
|
|
@@ -203,7 +205,7 @@ end
|
|
203
205
|
--set-env-vars="SOULS_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}"
|
204
206
|
TEXT
|
205
207
|
end
|
206
|
-
|
208
|
+
Souls::Painter.create_file(file_path.to_s)
|
207
209
|
file_path
|
208
210
|
end
|
209
211
|
|
data/lib/souls/cli/db/index.rb
CHANGED
data/lib/souls/cli/db/model.rb
CHANGED
@@ -8,7 +8,7 @@ module Souls
|
|
8
8
|
file_dir = "./sig/api/app/graphql/types/connections/"
|
9
9
|
file_path = "#{file_dir}#{singularized_class_name}_connection.rbs"
|
10
10
|
FileUtils.rm_f(file_path)
|
11
|
-
|
11
|
+
Souls::Painter.delete_file(file_path.to_s)
|
12
12
|
end
|
13
13
|
file_path
|
14
14
|
end
|
@@ -6,7 +6,7 @@ module Souls
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "#{file_dir}#{singularized_class_name}_edge.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
9
|
-
|
9
|
+
Souls::Painter.delete_file(file_path.to_s)
|
10
10
|
file_path
|
11
11
|
end
|
12
12
|
end
|
data/lib/souls/cli/delete/job.rb
CHANGED
@@ -7,7 +7,7 @@ module Souls
|
|
7
7
|
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
8
8
|
|
9
9
|
FileUtils.rm_f(file_path)
|
10
|
-
|
10
|
+
Souls::Painter.delete_file(file_path.to_s)
|
11
11
|
Souls::Delete.new.invoke(:job_rbs, [class_name], {})
|
12
12
|
Souls::Delete.new.invoke(:rspec_job, [class_name], {})
|
13
13
|
end
|
@@ -14,7 +14,7 @@ module Souls
|
|
14
14
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
15
15
|
file_path = "#{file_dir}#{singularized_class_name}.rbs"
|
16
16
|
FileUtils.rm_f(file_path)
|
17
|
-
|
17
|
+
Souls::Painter.delete_file(file_path.to_s)
|
18
18
|
end
|
19
19
|
file_path
|
20
20
|
end
|
@@ -8,7 +8,7 @@ module Souls
|
|
8
8
|
file_path = "#{file_dir}/#{options[:mutation]}.rb"
|
9
9
|
|
10
10
|
FileUtils.rm_f(file_path)
|
11
|
-
|
11
|
+
Souls::Painter.delete_file(file_path.to_s)
|
12
12
|
Souls::Delete.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
13
13
|
Souls::Delete.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
14
14
|
file_path
|
@@ -9,7 +9,7 @@ module Souls
|
|
9
9
|
file_dir = "./sig/api/app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
10
10
|
file_path = "#{file_dir}/#{options[:mutation]}.rbs"
|
11
11
|
FileUtils.rm_f(file_path)
|
12
|
-
|
12
|
+
Souls::Painter.delete_file(file_path.to_s)
|
13
13
|
end
|
14
14
|
file_path
|
15
15
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "migration [migration_NAME]", "Delete Migration files Template"
|
4
|
+
def migration(class_name)
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
pluralized_class_name = class_name.underscore.pluralize
|
7
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
8
|
+
file_paths = {
|
9
|
+
model_file_path: "./apps/api/app/models/#{singularized_class_name}.rb",
|
10
|
+
rspec_file_path: "./apps/api/spec/models/#{singularized_class_name}_spec.rb",
|
11
|
+
rbs_file_path: "./sig/api/app/models/#{singularized_class_name}.rbs",
|
12
|
+
migration_file_path: Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
13
|
+
}
|
14
|
+
file_paths.each do |_k, v|
|
15
|
+
FileUtils.rm_f(v)
|
16
|
+
Souls::Painter.delete_file(v)
|
17
|
+
rescue StandardError => e
|
18
|
+
puts(e)
|
19
|
+
end
|
20
|
+
file_paths
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -8,7 +8,7 @@ module Souls
|
|
8
8
|
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/"
|
9
9
|
FileUtils.rm_rf(file_path)
|
10
10
|
end
|
11
|
-
|
11
|
+
Souls::Painter.delete_file(file_path.to_s)
|
12
12
|
file_path
|
13
13
|
end
|
14
14
|
end
|
@@ -8,7 +8,7 @@ module Souls
|
|
8
8
|
file_dir = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
|
9
9
|
FileUtils.rm_rf(file_dir)
|
10
10
|
end
|
11
|
-
|
11
|
+
Souls::Painter.delete_file(file_path.to_s)
|
12
12
|
file_path
|
13
13
|
end
|
14
14
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize
|
6
6
|
file_path = "./app/graphql/queries/#{singularized_class_name}*.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -8,7 +8,7 @@ module Souls
|
|
8
8
|
singularized_class_name = class_name.underscore.singularize
|
9
9
|
file_path = "#{file_dir}#{singularized_class_name}*.rbs"
|
10
10
|
FileUtils.rm_f(file_path)
|
11
|
-
|
11
|
+
Souls::Painter.delete_file(file_path.to_s)
|
12
12
|
file_path
|
13
13
|
end
|
14
14
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize.underscore
|
6
6
|
file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -9,7 +9,7 @@ module Souls
|
|
9
9
|
file_path = "#{file_dir}/#{singularized_class_name}_search.rbs"
|
10
10
|
FileUtils.rm_f(file_path)
|
11
11
|
end
|
12
|
-
|
12
|
+
Souls::Painter.delete_file(file_path.to_s)
|
13
13
|
file_path
|
14
14
|
end
|
15
15
|
end
|
@@ -4,7 +4,7 @@ module Souls
|
|
4
4
|
def rspec_factory(class_name)
|
5
5
|
file_path = "./spec/factories/#{class_name.pluralize}.rb"
|
6
6
|
FileUtils.rm_f(file_path)
|
7
|
-
|
7
|
+
Souls::Painter.delete_file(file_path.to_s)
|
8
8
|
file_path
|
9
9
|
end
|
10
10
|
end
|
@@ -6,7 +6,7 @@ module Souls
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "#{file_dir}/#{singularized_class_name}_spec.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
9
|
-
|
9
|
+
Souls::Painter.delete_file(file_path.to_s)
|
10
10
|
file_path
|
11
11
|
end
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Souls
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "./spec/mutations/managers/#{singularized_class_name}/#{options[:mutation]}_spec.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
9
|
-
|
9
|
+
Souls::Painter.delete_file(file_path.to_s)
|
10
10
|
file_path
|
11
11
|
end
|
12
12
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize
|
6
6
|
file_path = "./spec/mutations/base/#{singularized_class_name}_spec.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize
|
6
6
|
file_path = "./spec/queries/#{singularized_class_name}_spec.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize
|
6
6
|
file_path = "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Souls
|
|
5
5
|
singularized_class_name = class_name.singularize
|
6
6
|
file_path = "./app/graphql/types/#{singularized_class_name}_type.rb"
|
7
7
|
FileUtils.rm_f(file_path)
|
8
|
-
|
8
|
+
Souls::Painter.delete_file(file_path.to_s)
|
9
9
|
file_path
|
10
10
|
end
|
11
11
|
end
|
@@ -9,7 +9,7 @@ module Souls
|
|
9
9
|
file_path = "#{file_dir}/#{singularized_class_name}_type.rbs"
|
10
10
|
FileUtils.rm_f(file_path)
|
11
11
|
end
|
12
|
-
|
12
|
+
Souls::Painter.delete_file(file_path.to_s)
|
13
13
|
file_path
|
14
14
|
end
|
15
15
|
end
|
@@ -16,7 +16,7 @@ module Souls
|
|
16
16
|
Souls::Sql.new.invoke(:setup_private_ip)
|
17
17
|
update_workflows
|
18
18
|
update_env
|
19
|
-
|
19
|
+
Souls::Painter.success("Cloud NAT is All Set!")
|
20
20
|
puts(
|
21
21
|
Paint % [
|
22
22
|
"Your Worker's External IP: %{white_text}",
|
@@ -133,7 +133,7 @@ module Souls
|
|
133
133
|
end
|
134
134
|
workflow.insert(index, " --vpc-connector=#{app_name}-connector \\\n") if connector_index.nil?
|
135
135
|
File.open(file_path, "w") { |f| f.write(workflow.join) }
|
136
|
-
|
136
|
+
Souls::Painter.update_file(file_path.to_s)
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
@@ -14,43 +14,47 @@ module Souls
|
|
14
14
|
|
15
15
|
zone = "#{region}-b"
|
16
16
|
system("gcloud config set project #{project_id} >/dev/null 2>&1")
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
17
|
+
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
18
|
+
system(
|
19
|
+
"gcloud sql instances create #{instance_name} \
|
20
|
+
--database-version=#{db_type} --cpu=1 --memory=4096MB --zone=#{zone} \
|
21
|
+
--root-password='#{password}' --database-flags cloudsql.iam_authentication=on"
|
22
|
+
)
|
23
|
+
instance_ip = `gcloud sql instances list | grep #{instance_name} | awk '{print $5}'`.strip
|
24
|
+
Dir.chdir(Souls.get_api_path.to_s) do
|
25
|
+
file_path = ".env"
|
26
|
+
File.open(file_path, "w") do |line|
|
27
|
+
line.write(<<~TEXT)
|
28
|
+
GOOGLE_AUTH_SUPPRESS_CREDENTIALS_WARNINGS=1
|
29
|
+
SOULS_DB_HOST=#{instance_ip}
|
30
|
+
SOULS_DB_PW=#{password}
|
31
|
+
SOULS_DB_USER=postgres
|
32
|
+
SOULS_GCP_PROJECT_ID=#{project_id}
|
33
|
+
SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
|
34
|
+
TZ="#{region_to_timezone(region: region)}"
|
35
|
+
TEXT
|
36
|
+
end
|
35
37
|
end
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
38
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
39
|
+
file_path = ".env.production"
|
40
|
+
File.open(file_path, "w") do |line|
|
41
|
+
line.write(<<~TEXT)
|
42
|
+
SOULS_DB_HOST="/cloudsql/#{project_id}:#{region}:#{instance_name}"
|
43
|
+
SOULS_DB_PW=#{password}
|
44
|
+
SOULS_DB_USER=postgres
|
45
|
+
SOULS_APP_NAME=#{app_name}
|
46
|
+
SOULS_GCP_PROJECT_ID=#{project_id}
|
47
|
+
SOULS_GCP_REGION=#{region}
|
48
|
+
SOULS_GCLOUDSQL_INSTANCE="#{project_id}:#{region}:#{instance_name}"
|
49
|
+
SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
|
50
|
+
TZ="#{region_to_timezone(region: region)}"
|
51
|
+
TEXT
|
52
|
+
end
|
51
53
|
end
|
54
|
+
Souls::Github.new.secret_set
|
55
|
+
Whirly.status = Paint["Cloud SQL #{instance_name} is successfully created! You can push to deploy!", :green]
|
52
56
|
end
|
53
|
-
|
57
|
+
true
|
54
58
|
end
|
55
59
|
|
56
60
|
desc "list", "Show Cloud SQL Instances List"
|
@@ -130,15 +134,19 @@ module Souls
|
|
130
134
|
ips = (ips + white_ips).uniq
|
131
135
|
end
|
132
136
|
ips = ips.join(",")
|
133
|
-
|
134
|
-
|
137
|
+
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
138
|
+
system(
|
139
|
+
"
|
135
140
|
gcloud sql instances patch #{instance_name} \
|
136
141
|
--project=#{project_id} \
|
137
142
|
--assign-ip \
|
138
143
|
--authorized-networks=#{ips} \
|
139
144
|
--quiet
|
140
145
|
"
|
141
|
-
|
146
|
+
)
|
147
|
+
Whirly.status = Paint["Your IP is successfully added!", :green]
|
148
|
+
end
|
149
|
+
true
|
142
150
|
end
|
143
151
|
|
144
152
|
private
|
@@ -11,7 +11,7 @@ module Souls
|
|
11
11
|
File.open(file_path, "w") do |f|
|
12
12
|
f.write(<<~TEXT)
|
13
13
|
module Types
|
14
|
-
class #{singularized_class_name.camelize}Edge <
|
14
|
+
class #{singularized_class_name.camelize}Edge < Types::BaseEdge
|
15
15
|
def self.edge_type: (*untyped) -> untyped
|
16
16
|
def self.node_type: (*untyped) -> untyped
|
17
17
|
def self.global_id_field: (*untyped) -> untyped
|
@@ -20,7 +20,7 @@ module Souls
|
|
20
20
|
end
|
21
21
|
TEXT
|
22
22
|
end
|
23
|
-
|
23
|
+
Souls::Painter.create_file(file_path.to_s)
|
24
24
|
end
|
25
25
|
file_path
|
26
26
|
end
|
@@ -37,7 +37,7 @@ module Souls
|
|
37
37
|
end
|
38
38
|
TEXT
|
39
39
|
end
|
40
|
-
|
40
|
+
Souls::Painter.create_file(file_path.to_s)
|
41
41
|
file_path
|
42
42
|
end
|
43
43
|
|
@@ -56,7 +56,7 @@ module Souls
|
|
56
56
|
end
|
57
57
|
TEXT
|
58
58
|
end
|
59
|
-
|
59
|
+
Souls::Painter.create_file(file_path.to_s)
|
60
60
|
file_path
|
61
61
|
end
|
62
62
|
|
@@ -95,7 +95,7 @@ module Souls
|
|
95
95
|
end
|
96
96
|
TEXT
|
97
97
|
end
|
98
|
-
|
98
|
+
Souls::Painter.create_file(file_path.to_s)
|
99
99
|
file_path
|
100
100
|
end
|
101
101
|
|
@@ -114,7 +114,7 @@ module Souls
|
|
114
114
|
end
|
115
115
|
TEXT
|
116
116
|
end
|
117
|
-
|
117
|
+
Souls::Painter.create_file(file_path.to_s)
|
118
118
|
file_path
|
119
119
|
end
|
120
120
|
end
|
@@ -32,7 +32,7 @@ module Souls
|
|
32
32
|
end
|
33
33
|
TEXT
|
34
34
|
end
|
35
|
-
|
35
|
+
Souls::Painter.create_file(file_path.to_s)
|
36
36
|
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [type_file_path.to_s, :white] }])
|
37
37
|
end
|
38
38
|
file_path
|
@@ -13,7 +13,7 @@ module Souls
|
|
13
13
|
f.write(<<~TEXT)
|
14
14
|
module Mutations
|
15
15
|
module Managers
|
16
|
-
module #{singularized_class_name.camelize}Manager
|
16
|
+
module #{singularized_class_name.camelize}Manager < BaseMutation
|
17
17
|
class #{options[:mutation].singularize.camelize}
|
18
18
|
def self.description: (String)-> untyped
|
19
19
|
def self.argument: (untyped, untyped, untyped)-> untyped
|
@@ -23,7 +23,7 @@ module Souls
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
TEXT
|
26
|
-
|
26
|
+
Souls::Painter.create_file(file_path.to_s)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
file_path
|
@@ -83,7 +83,7 @@ module Souls
|
|
83
83
|
end
|
84
84
|
TEXT
|
85
85
|
end
|
86
|
-
|
86
|
+
Souls::Painter.create_file(file_path.to_s)
|
87
87
|
file_path
|
88
88
|
end
|
89
89
|
|
@@ -155,7 +155,7 @@ module Souls
|
|
155
155
|
end
|
156
156
|
TEXT
|
157
157
|
end
|
158
|
-
|
158
|
+
Souls::Painter.create_file(file_path.to_s)
|
159
159
|
file_path
|
160
160
|
end
|
161
161
|
|
@@ -183,7 +183,7 @@ module Souls
|
|
183
183
|
end
|
184
184
|
TEXT
|
185
185
|
end
|
186
|
-
|
186
|
+
Souls::Painter.create_file(file_path.to_s)
|
187
187
|
file_path
|
188
188
|
end
|
189
189
|
|
@@ -211,7 +211,7 @@ module Souls
|
|
211
211
|
end
|
212
212
|
TEXT
|
213
213
|
end
|
214
|
-
|
214
|
+
Souls::Painter.create_file(file_path.to_s)
|
215
215
|
file_path
|
216
216
|
rescue StandardError => e
|
217
217
|
puts(e)
|
@@ -97,7 +97,7 @@ module Souls
|
|
97
97
|
TEXT
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
Souls::Painter.create_file(file_path.to_s)
|
101
101
|
file_path
|
102
102
|
end
|
103
103
|
|
@@ -176,7 +176,7 @@ module Souls
|
|
176
176
|
TEXT
|
177
177
|
end
|
178
178
|
end
|
179
|
-
|
179
|
+
Souls::Painter.create_file(file_path.to_s)
|
180
180
|
file_path
|
181
181
|
end
|
182
182
|
|
@@ -204,7 +204,7 @@ module Souls
|
|
204
204
|
end
|
205
205
|
TEXT
|
206
206
|
end
|
207
|
-
|
207
|
+
Souls::Painter.create_file(file_path.to_s)
|
208
208
|
end
|
209
209
|
file_path
|
210
210
|
end
|
@@ -233,7 +233,7 @@ module Souls
|
|
233
233
|
end
|
234
234
|
TEXT
|
235
235
|
end
|
236
|
-
|
236
|
+
Souls::Painter.create_file(file_path.to_s)
|
237
237
|
end
|
238
238
|
file_path
|
239
239
|
end
|
@@ -28,7 +28,7 @@ module Souls
|
|
28
28
|
end
|
29
29
|
TEXT
|
30
30
|
end
|
31
|
-
|
31
|
+
Souls::Painter.create_file(file_path.to_s)
|
32
32
|
file_path
|
33
33
|
rescue StandardError => e
|
34
34
|
raise(StandardError, e)
|
@@ -52,7 +52,7 @@ module Souls
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
TEXT
|
55
|
-
|
55
|
+
Souls::Painter.create_file(file_path.to_s)
|
56
56
|
file_path
|
57
57
|
rescue StandardError => e
|
58
58
|
raise(StandardError, e)
|
@@ -31,7 +31,7 @@ module Souls
|
|
31
31
|
end
|
32
32
|
TEXT
|
33
33
|
end
|
34
|
-
|
34
|
+
Souls::Painter.create_file(file_path.to_s)
|
35
35
|
end
|
36
36
|
file_path
|
37
37
|
end
|
@@ -55,7 +55,7 @@ module Souls
|
|
55
55
|
end
|
56
56
|
TEXT
|
57
57
|
end
|
58
|
-
|
58
|
+
Souls::Painter.create_file(file_path.to_s)
|
59
59
|
end
|
60
60
|
file_path
|
61
61
|
end
|
@@ -11,7 +11,7 @@ module Souls
|
|
11
11
|
resolver_after_params(class_name: singularized_class_name)
|
12
12
|
resolver_before_end(class_name: singularized_class_name)
|
13
13
|
resolver_end(class_name: singularized_class_name)
|
14
|
-
|
14
|
+
Souls::Painter.create_file(file_path.to_s)
|
15
15
|
file_path
|
16
16
|
end
|
17
17
|
|
@@ -24,7 +24,7 @@ module Souls
|
|
24
24
|
def decode_global_key: (String value) -> Integer
|
25
25
|
def apply_filter: (untyped scope, untyped value) -> untyped
|
26
26
|
|
27
|
-
class #{singularized_class_name.camelize}Filter
|
27
|
+
class #{singularized_class_name.camelize}Filter < Souls::Types::BaseInputObject
|
28
28
|
String: String
|
29
29
|
Boolean: Boolean
|
30
30
|
Integer: Integer
|
@@ -33,7 +33,7 @@ module Souls
|
|
33
33
|
TEXT
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
36
|
+
Souls::Painter.create_file(file_path.to_s)
|
37
37
|
file_path
|
38
38
|
end
|
39
39
|
end
|
@@ -9,7 +9,7 @@ module Souls
|
|
9
9
|
rspec_factory_head(class_name: singularized_class_name)
|
10
10
|
rspec_factory_params(class_name: singularized_class_name)
|
11
11
|
rspec_factory_end(class_name: singularized_class_name)
|
12
|
-
|
12
|
+
Souls::Painter.create_file(file_path.to_s)
|
13
13
|
file_path
|
14
14
|
end
|
15
15
|
|
@@ -11,7 +11,7 @@ module Souls
|
|
11
11
|
rspec_mutation_params(class_name: singularized_class_name)
|
12
12
|
rspec_mutation_params_response(class_name: singularized_class_name)
|
13
13
|
rspec_mutation_end(class_name: singularized_class_name)
|
14
|
-
|
14
|
+
Souls::Painter.create_file(file_path.to_s)
|
15
15
|
file_path
|
16
16
|
rescue StandardError => e
|
17
17
|
raise(StandardError, e)
|
@@ -10,7 +10,7 @@ module Souls
|
|
10
10
|
rspec_query_after_head(singularized_class_name)
|
11
11
|
rspec_query_params(singularized_class_name)
|
12
12
|
rspec_query_end(singularized_class_name)
|
13
|
-
|
13
|
+
Souls::Painter.create_file(file_path.to_s)
|
14
14
|
file_path
|
15
15
|
end
|
16
16
|
|
@@ -10,7 +10,7 @@ module Souls
|
|
10
10
|
rspec_resolver_after_head(singularized_class_name)
|
11
11
|
rspec_resolver_params(singularized_class_name)
|
12
12
|
rspec_resolver_end(singularized_class_name)
|
13
|
-
|
13
|
+
Souls::Painter.create_file(file_path.to_s)
|
14
14
|
file_path
|
15
15
|
end
|
16
16
|
|
@@ -9,7 +9,7 @@ module Souls
|
|
9
9
|
create_type_head(class_name: singularized_class_name)
|
10
10
|
create_type_params(class_name: singularized_class_name)
|
11
11
|
create_type_end(class_name: singularized_class_name)
|
12
|
-
|
12
|
+
Souls::Painter.create_file(file_path.to_s)
|
13
13
|
file_path
|
14
14
|
end
|
15
15
|
|
@@ -33,14 +33,16 @@ module Souls
|
|
33
33
|
remote_url = `git remote get-url origin`
|
34
34
|
split_url = %r{(https://|git@)(github.com)(:|/)([^.]+/[^.]+)(\.git)?}.match(remote_url)
|
35
35
|
if split_url.nil? || split_url.size != 6
|
36
|
-
|
36
|
+
Souls::Painter.error("Cannot access Github, please check your credentials")
|
37
|
+
return
|
37
38
|
end
|
38
39
|
|
39
40
|
api_request = "gh api -X GET 'repos/#{split_url[4]}/actions/runs'"
|
40
41
|
workflows = JSON.parse(`#{api_request}`)
|
41
42
|
|
42
43
|
if workflows.nil? || !workflows.key?("workflow_runs")
|
43
|
-
|
44
|
+
Souls::Painter.error("Failed to parse JSON response from Github")
|
45
|
+
return
|
44
46
|
end
|
45
47
|
|
46
48
|
wf_info =
|
@@ -51,7 +53,8 @@ module Souls
|
|
51
53
|
wf_id =
|
52
54
|
case wf_info.size
|
53
55
|
when 0
|
54
|
-
|
56
|
+
Souls::Painter.error("No workflow is running")
|
57
|
+
return
|
55
58
|
when 1
|
56
59
|
wf_info[0].values[0]
|
57
60
|
else
|
@@ -70,7 +73,7 @@ module Souls
|
|
70
73
|
File.open(file_path, "a") do |line|
|
71
74
|
dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
|
72
75
|
end
|
73
|
-
|
76
|
+
Souls::Painter.update_file(file_path.to_s)
|
74
77
|
end
|
75
78
|
end
|
76
79
|
|
@@ -80,7 +83,7 @@ module Souls
|
|
80
83
|
File.open(file_path, "a") do |line|
|
81
84
|
dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
|
82
85
|
end
|
83
|
-
|
86
|
+
Souls::Painter.update_file(file_path.to_s)
|
84
87
|
end
|
85
88
|
end
|
86
89
|
|
@@ -93,7 +96,7 @@ module Souls
|
|
93
96
|
File.open(file_path, "a") do |line|
|
94
97
|
dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
|
95
98
|
end
|
96
|
-
|
99
|
+
Souls::Painter.update_file(file_path.to_s)
|
97
100
|
end
|
98
101
|
end
|
99
102
|
end
|
@@ -106,7 +109,7 @@ module Souls
|
|
106
109
|
worker_workflow[worker_workflow.size - 1] = worker_workflow.last.chomp
|
107
110
|
worker_workflow << " \\\n --set-env-vars=\"#{key.upcase}=${{ secrets.#{key.upcase} }}\""
|
108
111
|
File.open(file_path, "w") { |f| f.write(worker_workflow.join) }
|
109
|
-
|
112
|
+
Souls::Painter.update_file(file_path.to_s)
|
110
113
|
end
|
111
114
|
end
|
112
115
|
end
|
data/lib/souls/cli/sync/conf.rb
CHANGED
@@ -5,15 +5,13 @@ module Souls
|
|
5
5
|
Souls::Gcloud.new.config_set
|
6
6
|
update_conf
|
7
7
|
update_conf(strain: "api")
|
8
|
-
|
9
|
-
Paint % [
|
10
|
-
"Synced! : %{white_text}",
|
11
|
-
:green,
|
12
|
-
{ white_text: ["`config/souls.rb`, `apps/api/config/souls.rb`", :white] }
|
13
|
-
]
|
14
|
-
)
|
8
|
+
Souls::Painter.sync("`config/souls.rb`, `apps/api/config/souls.rb`")
|
15
9
|
end
|
16
10
|
|
11
|
+
# rubocop:disable Style/StringHashKeys
|
12
|
+
map "config" => "conf"
|
13
|
+
# rubocop:enable Style/StringHashKeys
|
14
|
+
|
17
15
|
private
|
18
16
|
|
19
17
|
def update_conf(strain: "mother")
|
data/lib/souls/cli/sync/model.rb
CHANGED
@@ -9,15 +9,13 @@ module Souls
|
|
9
9
|
dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
|
10
10
|
file_path = "#{dir_name}/create_#{singularized_class_name}.rb"
|
11
11
|
unless File.exist?(file_path)
|
12
|
-
|
13
|
-
|
14
|
-
"File #{file_path} is missing. Please recreate it and then run this command again."
|
15
|
-
)
|
12
|
+
Souls::Painter.error("File #{file_path} is missing. Please recreate it and then run this command again.")
|
13
|
+
return
|
16
14
|
end
|
17
15
|
|
18
16
|
mutation_argument = check_mutation_argument(class_name: "user", action: "create")
|
19
17
|
overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
|
20
|
-
|
18
|
+
Souls::Painter.update_file(file_path.to_s)
|
21
19
|
end
|
22
20
|
|
23
21
|
desc "update_mutation [CLASS_NAME]", "Update GraphQL Type from schema.rb"
|
@@ -27,16 +25,14 @@ module Souls
|
|
27
25
|
dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
|
28
26
|
file_path = "#{dir_name}/update_#{singularized_class_name}.rb"
|
29
27
|
unless File.exist?(file_path)
|
30
|
-
|
31
|
-
|
32
|
-
"File #{file_path} is missing. Please recreate it and then run this command again."
|
33
|
-
)
|
28
|
+
Souls::Painter.error("File #{file_path} is missing. Please recreate it and then run this command again.")
|
29
|
+
return
|
34
30
|
end
|
35
31
|
|
36
32
|
mutation_argument = check_mutation_argument(class_name: class_name, action: "update")
|
37
33
|
overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
|
38
34
|
|
39
|
-
|
35
|
+
Souls::Painter.update_file(file_path.to_s)
|
40
36
|
end
|
41
37
|
|
42
38
|
private
|
@@ -56,7 +56,7 @@ module Souls
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
File.open(file_path, "w") { |f| f.write(write_txt) }
|
59
|
-
|
59
|
+
Souls::Painter.update_file(file_path.to_s)
|
60
60
|
end
|
61
61
|
|
62
62
|
desc "update_mutation [CLASS_NAME]", "Update GraphQL Type from schema.rb"
|
@@ -120,7 +120,7 @@ module Souls
|
|
120
120
|
end
|
121
121
|
FileUtils.rm(file_path)
|
122
122
|
FileUtils.mv(new_file_path, file_path)
|
123
|
-
|
123
|
+
Souls::Painter.update_file(file_path.to_s)
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.13.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.13.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: 1.
|
4
|
+
version: 1.13.0
|
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-
|
13
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/souls/app/graphql/types/index.rb
|
171
171
|
- lib/souls/app/index.rb
|
172
172
|
- lib/souls/app/utils/firebase_id_token.rb
|
173
|
+
- lib/souls/app/utils/painter.rb
|
173
174
|
- lib/souls/app/utils/souls_logger.rb
|
174
175
|
- lib/souls/cli.rb
|
175
176
|
- lib/souls/cli/cli_exception.rb
|
@@ -191,6 +192,7 @@ files:
|
|
191
192
|
- lib/souls/cli/delete/job_rbs.rb
|
192
193
|
- lib/souls/cli/delete/manager.rb
|
193
194
|
- lib/souls/cli/delete/manager_rbs.rb
|
195
|
+
- lib/souls/cli/delete/migration_file.rb
|
194
196
|
- lib/souls/cli/delete/mutation.rb
|
195
197
|
- lib/souls/cli/delete/mutation_rbs.rb
|
196
198
|
- lib/souls/cli/delete/query.rb
|