souls 0.34.0 → 0.35.1

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: 57d030af03262c0c43a17ca994c3d9c8749c86b82559cc6ab8671e116dd4d2cb
4
- data.tar.gz: b811181cd1a1d8403c5d8b4891b2ef53a1f0ca3afaaa872267aa5e427a85f40c
3
+ metadata.gz: b8625ab69f5ec380190e85dab85d3f009bad3491fdd918bfa8a005638ef6ddf6
4
+ data.tar.gz: e5cc98017cf840f7949ed4d874e034873003037b14a55404c8a2b371bbca2ae0
5
5
  SHA512:
6
- metadata.gz: a0a1e0d953f4f11e1b9ab492b1fd87eab1f9f2626b6a86ef76976af41c1954e41d9e2c8e005ec414f891beab88cc3ad340e8d7b48a4485383f23193549c9866f
7
- data.tar.gz: 3e6a4f9cf9ab8921505e8afb7aa69eac5d5f2cacd1ea1cbc29cf65310d1ee92d80d64f7af8163970b6ac0b1ce2116b80b189d619965fe3b07942aa39f2c34648
6
+ metadata.gz: 9fddd29570fb4b28f582a2b7cae62526937ffc6d62317b88a3557c13745894127175974a6a67b6fe605947afaf48c97122c7c892e4999a374c5c792a0e030e97
7
+ data.tar.gz: 7b77d8ce7a9a246f3559de23c140898a4eb28c61904063eec0a4b5afb2ebeea83460d84053ffece3dcfc863f3bd1bcc48fe0f1f03f18c983a1f25116b3666406
@@ -0,0 +1,67 @@
1
+ module Souls
2
+ module Gcloud
3
+ module Compute
4
+ class << self
5
+ def create_network(app_name: "")
6
+ app_name = Souls.configuration.app if app_name.blank?
7
+ system("gcloud compute networks create #{app_name}")
8
+ end
9
+
10
+ def create_firewall_tcp(app_name: "", range: "10.124.0.0/28")
11
+ app_name = Souls.configuration.app if app_name.blank?
12
+ system(
13
+ "gcloud compute firewall-rules create #{app_name} \
14
+ --network #{app_name} --allow tcp,udp,icmp --source-ranges #{range}"
15
+ )
16
+ end
17
+
18
+ def create_firewall_ssh(app_name: "")
19
+ app_name = Souls.configuration.app if app_name.blank?
20
+ system(
21
+ "gcloud compute firewall-rules create #{app_name}-ssh --network #{app_name} \
22
+ --allow tcp:22,tcp:3389,icmp"
23
+ )
24
+ end
25
+
26
+ def create_subnet(app_name: "", region: "asia-northeast1", range: "10.124.0.0/28")
27
+ app_name = Souls.configuration.app if app_name.blank?
28
+ system(
29
+ "gcloud compute networks subnets create #{app_name}-subnet
30
+ --range=#{range} --network=#{app_name} --region=#{region}"
31
+ )
32
+ end
33
+
34
+ def create_connector(app_name: "", region: "asia-northeast1")
35
+ app_name = Souls.configuration.app if app_name.blank?
36
+ project_id = Souls.configuration.app if project_id.blank?
37
+ system(
38
+ "gcloud compute networks vpc-access connectors create #{app_name}-connector \
39
+ --region=#{region} \
40
+ --subnet-project=#{project_id} \
41
+ --subnet=#{app_name}-subnet"
42
+ )
43
+ end
44
+
45
+ def create_external_ip(app_name: "", region: "asia-northeast1")
46
+ app_name = Souls.configuration.app if app_name.blank?
47
+ system("gcloud compute addresses create #{app_name}-worker-ip --region=#{region}")
48
+ end
49
+
50
+ def create_nat(app_name: "", region: "asia-northeast1")
51
+ app_name = Souls.configuration.app if app_name.blank?
52
+ system(
53
+ "gcloud compute routers nats create #{app_name}-worker-nat \
54
+ --router=#{app_name}-router \
55
+ --region=#{region} \
56
+ --nat-custom-subnet-ip-ranges=#{app_name}-subnet \
57
+ --nat-external-ip-pool=#{app_name}-worker-ip"
58
+ )
59
+ end
60
+
61
+ def network_list
62
+ system("gcloud compute network list")
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -28,7 +28,7 @@ module Souls
28
28
  end
29
29
  key = text.join(",").gsub(/^,/, "").chomp!
30
30
  github_repo = `git remote show origin -n | grep 'Fetch URL:' | awk '{print $3}'`.strip
31
- github_repo = "https://github.com/#{github_repo.match(/\:(.+).git/)[1]}" if github_repo.include?("git@github")
31
+ github_repo = "https://github.com/#{github_repo.match(/:(.+).git/)[1]}" if github_repo.include?("git@github")
32
32
  puts(Paint[key, :white])
33
33
  puts(Paint["======= above(ここまで)=======", :cyan])
34
34
  github_secret_url = "#{github_repo}/settings/secrets/actions"
@@ -53,7 +53,9 @@ module Souls
53
53
  FileUtils.rm(file_path)
54
54
  end
55
55
 
56
- def add_service_account_role(service_account: "souls-app", project_id: "souls-app", role: "roles/firebase.admin")
56
+ def add_service_account_role(
57
+ service_account: "souls-app", project_id: "souls-app", role: "roles/firebase.admin"
58
+ )
57
59
  system(
58
60
  "gcloud projects add-iam-policy-binding #{project_id} \
59
61
  --member='serviceAccount:#{service_account}@#{project_id}.iam.gserviceaccount.com' \
@@ -2,6 +2,7 @@ require_relative "./iam/index"
2
2
  require_relative "./pubsub/index"
3
3
  require_relative "./run/index"
4
4
  require_relative "./sql/index"
5
+ require_relative "./compute/index"
5
6
 
6
7
  module Souls
7
8
  module Gcloud
@@ -42,9 +42,10 @@ module Souls
42
42
  else
43
43
  api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
44
44
  worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
45
-
46
- api_latest_date = Time.parse(api_file_data.max)
47
- worker_latest_date = Time.parse(worker_file_data.max)
45
+ # rubocop:disable Style/DateTime
46
+ api_latest_date = DateTime.parse(api_file_data.max)
47
+ worker_latest_date = DateTime.parse(worker_file_data.max)
48
+ # rubocop:enable Style/DateTime
48
49
  end
49
50
 
50
51
  if api_latest_date < worker_latest_date
@@ -57,7 +58,7 @@ module Souls
57
58
  system("cp -r #{api_dir}/* #{worker_dir}")
58
59
  end
59
60
  rescue StandardError => e
60
- puts(Paint["`souls api g scaffold $model` at `api` dir first!", :red])
61
+ puts(Paint[e, :red])
61
62
  end
62
63
 
63
64
  def get_models_path(service_name: "api")
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.34.0".freeze
2
+ VERSION = "0.35.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.13.0
1
+ 0.14.1
@@ -1 +1 @@
1
- 0.13.0
1
+ 0.14.1
@@ -1,2 +1,2 @@
1
1
  require_relative "./mailer"
2
- require_relative "./mutation"
2
+ require_relative "./mutation"
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.35.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-08-29 00:00:00.000000000 Z
13
+ date: 2021-08-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -126,6 +126,7 @@ files:
126
126
  - lib/souls/api/update/rspec_resolver.rb
127
127
  - lib/souls/api/update/type.rb
128
128
  - lib/souls/cli/docker/index.rb
129
+ - lib/souls/cli/gcloud/compute/index.rb
129
130
  - lib/souls/cli/gcloud/iam/index.rb
130
131
  - lib/souls/cli/gcloud/index.rb
131
132
  - lib/souls/cli/gcloud/pubsub/index.rb
@@ -145,7 +146,6 @@ files:
145
146
  - lib/souls/version.rb
146
147
  - lib/souls/versions/.souls_api_version
147
148
  - lib/souls/versions/.souls_worker_version
148
- - lib/souls/worker/generate.rb
149
149
  - lib/souls/worker/generate/index.rb
150
150
  - lib/souls/worker/generate/mailer.rb
151
151
  - lib/souls/worker/generate/mutation.rb
@@ -157,7 +157,7 @@ metadata:
157
157
  homepage_uri: https://souls.elsoul.nl
158
158
  source_code_uri: https://github.com/elsoul/souls
159
159
  changelog_uri: https://github.com/elsoul/souls
160
- post_install_message:
160
+ post_install_message:
161
161
  rdoc_options: []
162
162
  require_paths:
163
163
  - lib
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubygems_version: 3.2.22
176
- signing_key:
176
+ signing_key:
177
177
  specification_version: 4
178
178
  summary: SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API と Worker はルーティングの必要がありません。
179
179
  クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。
File without changes