souls 0.49.0 → 0.51.2

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: acb1a478eea7adee5b08030cc7684079c61c2923638a26a12283ea1415a83578
4
- data.tar.gz: 7f705d45cfc5172d6ef3e9a3d2194113a8d698056457c28b541eb114acea93b7
3
+ metadata.gz: 62fc5434cd97d243c168e4524d26a39437f5237f16ee89778c4ea5995f244aee
4
+ data.tar.gz: 2368dfe07467e449a0548ab40a6155399918a9a1359b286bbf3351a7ff0349f7
5
5
  SHA512:
6
- metadata.gz: 569f199d2f30351f729939d09ed6cd63bd1d254f15b1750ebca5b07c7ebde57ebf9405c03861af4cd73d40adaa460b1550fedaf4dc5187f165724e0d01f89ba8
7
- data.tar.gz: 53082a4de7a34616c46e8015ac89fefedff53162434041d351575d258e3f5498184f270d8aae42c46e9790b64e0eabab495038129d3f7c49fe41773cea761c7d
6
+ metadata.gz: 8f2b2acef6fc5cb3678d6df40c0bdc2d56c7769fe20699bf214e32e70de341ef6110ba7b8fb2e63ae596f3d5da428beeb81fce1e126abe56aab982dc92f481fa
7
+ data.tar.gz: 4bb3d0636e6b9c6ee696ffc2fb623850368550f7b8dde0a7b10e334cc3d221a42fba0987f28cb1b781957f98ea82a714ca2cc9617553ce08a50b79ba3ea8a3dd
data/README.md CHANGED
@@ -102,6 +102,7 @@ souls upgrade gemfile
102
102
  Souls.configure do |config|
103
103
  config.app = "souls-api"
104
104
  config.project_id = "souls-api"
105
+ config.region = "asia-northeast1"
105
106
  config.endpoint = "/endpoint"
106
107
  config.strain = "api"
107
108
  config.fixed_gems = ["selenium-webdriver", "pg"]
@@ -23,7 +23,7 @@ module Souls
23
23
  file_dir = "apps/#{worker_name}"
24
24
  file_path = "#{file_dir}/Procfile.dev"
25
25
  File.open(file_path, "w") do |f|
26
- f.write("web: bundle exec puma -p #{port} -e development")
26
+ f.write("#{worker_name}: bundle exec puma -p #{port} -e development")
27
27
  end
28
28
  end
29
29
 
@@ -154,7 +154,7 @@ end
154
154
 
155
155
  - name: Deploy to Cloud Run
156
156
  run: |
157
- gcloud run deploy ${{ secrets.APP_NAME }}-#{worker_name} \\
157
+ gcloud run deploy ${{ secrets.APP_NAME }}-souls-#{worker_name} \\
158
158
  --service-account=${{ secrets.APP_NAME }}@${{ secrets.GCP_PROJECT_ID }}.iam.gserviceaccount.com \\
159
159
  --image=gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{secrets.APP_NAME}}-#{worker_name} \\
160
160
  --memory=4Gi \\
@@ -192,9 +192,10 @@ end
192
192
  Souls.configure do |config|
193
193
  config.app = "#{app_name}"
194
194
  config.project_id = "#{project_id}"
195
+ config.region = "asia-northeast1"
195
196
  config.endpoint = "/endpoint"
196
197
  config.strain = "worker"
197
- config.fixed_gems = ["excluded_gem"]
198
+ config.fixed_gems = ["spring"]
198
199
  config.workers = []
199
200
  end
200
201
  TEXT
@@ -2,50 +2,52 @@ module Souls
2
2
  module Gcloud
3
3
  module Compute
4
4
  class << self
5
- def setup_vpc_nat(app_name: "", region: "asia-northeast1", range: "10.124.0.0/28")
6
- create_network(app_name: app_name)
7
- create_firewall_tcp(app_name: app_name, range: range)
8
- create_firewall_ssh(app_name: app_name)
9
- create_subnet(app_name: app_name, region: region, range: range)
10
- create_connector(app_name: app_name, region: region)
11
- create_router(app_name: app_name, region: region)
12
- create_external_ip(app_name: app_name, region: region)
13
- create_nat(app_name: app_name, region: region)
14
- nat_credit(app_name: app_name)
5
+ def setup_vpc_nat(range: "10.124.0.0/28")
6
+ create_network
7
+ create_firewall_tcp(range: range)
8
+ create_firewall_ssh
9
+ create_subnet(range: range)
10
+ create_connector
11
+ create_router
12
+ create_external_ip
13
+ create_nat
14
+ nat_credit
15
15
  end
16
16
 
17
- def create_network(app_name: "")
18
- app_name = Souls.configuration.app if app_name.blank?
17
+ def create_network
18
+ app_name = Souls.configuration.app
19
19
  system("gcloud compute networks create #{app_name}")
20
20
  end
21
21
 
22
- def create_firewall_tcp(app_name: "", range: "10.124.0.0/28")
23
- app_name = Souls.configuration.app if app_name.blank?
22
+ def create_firewall_tcp(range: "10.124.0.0/28")
23
+ app_name = Souls.configuration.app
24
24
  system(
25
25
  "gcloud compute firewall-rules create #{app_name} \
26
26
  --network #{app_name} --allow tcp,udp,icmp --source-ranges #{range}"
27
27
  )
28
28
  end
29
29
 
30
- def create_firewall_ssh(app_name: "")
31
- app_name = Souls.configuration.app if app_name.blank?
30
+ def create_firewall_ssh
31
+ app_name = Souls.configuration.app
32
32
  system(
33
33
  "gcloud compute firewall-rules create #{app_name}-ssh --network #{app_name} \
34
34
  --allow tcp:22,tcp:3389,icmp"
35
35
  )
36
36
  end
37
37
 
38
- def create_subnet(app_name: "", region: "asia-northeast1", range: "10.124.0.0/28")
39
- app_name = Souls.configuration.app if app_name.blank?
38
+ def create_subnet(range: "10.124.0.0/28")
39
+ app_name = Souls.configuration.app
40
+ region = Souls.configuration.region
40
41
  system(
41
42
  "gcloud compute networks subnets create #{app_name}-subnet \
42
43
  --range=#{range} --network=#{app_name} --region=#{region}"
43
44
  )
44
45
  end
45
46
 
46
- def create_connector(app_name: "", region: "asia-northeast1")
47
- app_name = Souls.configuration.app if app_name.blank?
47
+ def create_connector
48
+ app_name = Souls.configuration.app
48
49
  project_id = Souls.configuration.project_id
50
+ region = Souls.configuration.region
49
51
  system(
50
52
  "gcloud compute networks vpc-access connectors create #{app_name}-connector \
51
53
  --region=#{region} \
@@ -54,18 +56,21 @@ module Souls
54
56
  )
55
57
  end
56
58
 
57
- def create_router(app_name: "", region: "asia-northeast1")
58
- app_name = Souls.configuration.app if app_name.blank?
59
+ def create_router
60
+ app_name = Souls.configuration.app
61
+ region = Souls.configuration.region
59
62
  system("gcloud compute routers create #{app_name}-router --network=#{app_name} --region=#{region}")
60
63
  end
61
64
 
62
- def create_external_ip(app_name: "", region: "asia-northeast1")
63
- app_name = Souls.configuration.app if app_name.blank?
65
+ def create_external_ip
66
+ app_name = Souls.configuration.app
67
+ region = Souls.configuration.region
64
68
  system("gcloud compute addresses create #{app_name}-worker-ip --region=#{region}")
65
69
  end
66
70
 
67
- def create_nat(app_name: "", region: "asia-northeast1")
68
- app_name = Souls.configuration.app if app_name.blank?
71
+ def create_nat
72
+ app_name = Souls.configuration.app
73
+ region = Souls.configuration.region
69
74
  system(
70
75
  "gcloud compute routers nats create #{app_name}-worker-nat \
71
76
  --router=#{app_name}-router \
@@ -79,8 +84,8 @@ module Souls
79
84
  system("gcloud compute network list")
80
85
  end
81
86
 
82
- def nat_credit(app_name: "")
83
- app_name = Souls.configuration.app if app_name.blank?
87
+ def nat_credit
88
+ app_name = Souls.configuration.app
84
89
  line = Paint["====================================", :yellow]
85
90
  puts("\n")
86
91
  puts(line)
@@ -2,8 +2,10 @@ module Souls
2
2
  module Gcloud
3
3
  module Sql
4
4
  class << self
5
- def create_instance(instance_name: "", root_pass: "Postgre123!", zone: "asia-northeast1-b")
5
+ def create_instance(root_pass: "PassWord")
6
6
  instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
7
+ region = Souls.configuration.region
8
+ zone = "#{region}-b"
7
9
  system(
8
10
  "gcloud sql instances create #{instance_name} \
9
11
  --database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} \
@@ -42,10 +42,11 @@ module Souls
42
42
  f.write(<<~TEXT)
43
43
  Souls.configure do |config|
44
44
  config.app = "#{app_name}"
45
- config.project_id = "#{app_name}-project"
45
+ config.project_id = "#{app_name}"
46
+ config.region = "asia-northeast1"
46
47
  config.endpoint = "/endpoint"
47
48
  config.strain = "api"
48
- config.fixed_gems = ["excluded_gem"]
49
+ config.fixed_gems = ["spring"]
49
50
  config.workers = []
50
51
  end
51
52
  TEXT
@@ -72,10 +73,11 @@ module Souls
72
73
  f.write(<<~TEXT)
73
74
  Souls.configure do |config|
74
75
  config.app = "#{app_name}"
75
- config.project_id = "#{app_name}-project"
76
+ config.project_id = "#{app_name}"
77
+ config.region = "asia-northeast1"
76
78
  config.endpoint = "/endpoint"
77
79
  config.strain = "mother"
78
- config.fixed_gems = ["excluded_gem"]
80
+ config.fixed_gems = ["spring"]
79
81
  config.workers = []
80
82
  end
81
83
  TEXT
@@ -59,7 +59,8 @@ module Souls
59
59
  pubsub = Google::Cloud::Pubsub.new
60
60
 
61
61
  topic = pubsub.topic(topic_id)
62
- topic.subscribe(subscription_id, endpoint: endpoint)
62
+ sub = topic.subscribe(subscription_id, endpoint: endpoint, deadline: 20)
63
+ sub.expires_in = nil
63
64
  puts("Push subscription #{subscription_id} created.")
64
65
  end
65
66
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.49.0".freeze
2
+ VERSION = "0.51.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.28.0
1
+ 0.30.2
@@ -1 +1 @@
1
- 0.28.0
1
+ 0.30.2
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.49.0
4
+ version: 0.51.2
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-09-10 00:00:00.000000000 Z
13
+ date: 2021-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport