souls 0.50.0 → 0.51.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/cli/create/index.rb +3 -2
- data/lib/souls/cli/gcloud/compute/index.rb +33 -28
- data/lib/souls/cli/gcloud/sql/index.rb +3 -1
- data/lib/souls/cli/init/index.rb +6 -4
- 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 +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7367fa762682e76ba67083cf1b6d602de00187a21a556c1e9a42c92cf50a154
|
4
|
+
data.tar.gz: a669713a544dea89c5481049ecd88bcb256cce2d571ba284998205563f3d7fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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("
|
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 = ["
|
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(
|
6
|
-
create_network
|
7
|
-
create_firewall_tcp(
|
8
|
-
create_firewall_ssh
|
9
|
-
create_subnet(
|
10
|
-
create_connector
|
11
|
-
create_router
|
12
|
-
create_external_ip
|
13
|
-
create_nat
|
14
|
-
nat_credit
|
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
|
18
|
-
app_name = Souls.configuration.app
|
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(
|
23
|
-
app_name = Souls.configuration.app
|
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
|
31
|
-
app_name = Souls.configuration.app
|
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(
|
39
|
-
app_name = Souls.configuration.app
|
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
|
47
|
-
app_name = Souls.configuration.app
|
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
|
58
|
-
app_name = Souls.configuration.app
|
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
|
63
|
-
app_name = Souls.configuration.app
|
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
|
68
|
-
app_name = Souls.configuration.app
|
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
|
83
|
-
app_name = Souls.configuration.app
|
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(
|
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} \
|
data/lib/souls/cli/init/index.rb
CHANGED
@@ -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}
|
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 = ["
|
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}
|
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 = ["
|
80
|
+
config.fixed_gems = ["spring"]
|
79
81
|
config.workers = []
|
80
82
|
end
|
81
83
|
TEXT
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.30.0
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.30.0
|