souls 1.4.11 → 1.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b723d5fe6fdbb86fb785d308781dc7d0c5a13fcf6db3e714141a4d97c03d9d9
|
4
|
+
data.tar.gz: aa7ba7e1d4848499fa60ce609fada98d04167890f45275e485e1abe385a2fb36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e141c28f1b61173a62faa5dbfcf1cb1d3e98d1ba68579ec1111583c03f34f43fec5a674caea856daf13912b3a0e0a7921c569cdf1b1d9de798fe1a70fa63ac1
|
7
|
+
data.tar.gz: 4ed055384cad39d2f1d82b7457cc8d3d08a3226e9af975ddb93b1340dc0e71c4939e483d6612d54b5a82ea49807618fc263042d96a674fddca3c4e8e77a19340
|
@@ -23,7 +23,7 @@ module Souls
|
|
23
23
|
desc "get_endpoint", "Show Worker's Endpoint"
|
24
24
|
def get_endpoint(worker_name: "")
|
25
25
|
project_id = Souls.configuration.project_id
|
26
|
-
`gcloud run services list --project #{project_id} | grep #{worker_name} | awk '{print $4}'`
|
26
|
+
`gcloud run services list --project #{project_id} | grep -x #{worker_name} | awk '{print $4}'`
|
27
27
|
rescue Thor::Error => e
|
28
28
|
raise(Thor::Error, e)
|
29
29
|
end
|
@@ -8,21 +8,22 @@ module Souls
|
|
8
8
|
password = prompt.mask("Set DB PassWord:")
|
9
9
|
app_name = Souls.configuration.app
|
10
10
|
project_id = Souls.configuration.project_id
|
11
|
-
instance_name = Souls.configuration.instance_name
|
11
|
+
instance_name = Souls.configuration.instance_name
|
12
12
|
region = Souls.configuration.region if options[:region].blank?
|
13
13
|
db_type = options[:mysql] ? "MYSQL_8_0" : "POSTGRES_13"
|
14
14
|
|
15
15
|
zone = "#{region}-b"
|
16
16
|
system(
|
17
17
|
"gcloud sql instances create #{instance_name} \
|
18
|
-
--database-version=#{db_type} --cpu=1 --memory=
|
18
|
+
--database-version=#{db_type} --cpu=1 --memory=4096MB --zone=#{zone} \
|
19
19
|
--root-password='#{password}' --database-flags cloudsql.iam_authentication=on"
|
20
20
|
)
|
21
|
+
instance_ip = `gcloud sql instances list | grep -x #{instance_name} | awk '{print $5}'`.strip
|
21
22
|
Dir.chdir(Souls.get_api_path.to_s) do
|
22
23
|
file_path = ".env"
|
23
24
|
File.open(file_path, "w") do |line|
|
24
25
|
line.write(<<~TEXT)
|
25
|
-
SOULS_DB_HOST=#{
|
26
|
+
SOULS_DB_HOST=#{instance_ip}
|
26
27
|
SOULS_DB_PW=#{password}
|
27
28
|
SOULS_DB_USER=postgres
|
28
29
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
@@ -36,7 +37,7 @@ module Souls
|
|
36
37
|
File.open(file_path, "w") do |line|
|
37
38
|
line.write(<<~TEXT)
|
38
39
|
SOULS_DB_HOST="/cloudsql/#{project_id}:#{region}:#{instance_name}"
|
39
|
-
SOULS_DB_PW=#{
|
40
|
+
SOULS_DB_PW=#{password}
|
40
41
|
SOULS_DB_USER=postgres
|
41
42
|
SOULS_APP_NAME=#{app_name}
|
42
43
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
@@ -133,10 +134,6 @@ module Souls
|
|
133
134
|
|
134
135
|
private
|
135
136
|
|
136
|
-
def get_sql_ip
|
137
|
-
`gcloud sql instances list | grep james | awk '{print $5}'`
|
138
|
-
end
|
139
|
-
|
140
137
|
def region_to_timezone(region: "asia-northeast1")
|
141
138
|
if region.include?("asia")
|
142
139
|
"Asia/Tokyo"
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.2
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.2
|
data/lib/souls.rb
CHANGED