souls 0.50.0 → 0.51.0

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: f09e978fcff3505869e0f90ec0361236dc9ab49060a02877ee2be566920873d2
4
- data.tar.gz: d752f6115d32fed0193905455e0cac1ffb799d3e2845a8e7f71807955de399ec
3
+ metadata.gz: a7367fa762682e76ba67083cf1b6d602de00187a21a556c1e9a42c92cf50a154
4
+ data.tar.gz: a669713a544dea89c5481049ecd88bcb256cce2d571ba284998205563f3d7fb9
5
5
  SHA512:
6
- metadata.gz: 48020ee00fc64db00d1f98c08aa087fe2dd41bb1bbfdf0b5c68d418bd3ce90726c43016bd6c5215fdb338c01ab4e5fba046d147aeb64878728b1f565899750b4
7
- data.tar.gz: 91398508a99065252a54dabc29141bea6432ba0448936796ba2eda2c10eb64d8340b2763ebcab1c61e5ca10851628997a97f4953e499d109c6fa489da40255b3
6
+ metadata.gz: 943d98643861cab7f4a4f6b87f14f3e8704fd25bfff163c57a8998d12379935aea9680b41c7c540470f189878c8eb5dfeace448e2c36c65b73ce89f0b93ce98d
7
+ data.tar.gz: df0a5eaba3954eb7b7c2a2dc1b3f8e9393598a1eb2ec52c47c418f3ad2e7c2ba657c883e6b234c685e3e756c8d1e99d7412df9204851199099f8962dfb8989c6
@@ -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
 
@@ -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
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.50.0".freeze
2
+ VERSION = "0.51.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.29.0
1
+ 0.30.0
@@ -1 +1 @@
1
- 0.29.0
1
+ 0.30.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: 0.50.0
4
+ version: 0.51.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI