souls 1.4.12 → 1.5.3
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 +4 -4
- data/lib/souls/cli/gcloud/sql/index.rb +5 -7
- 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
- data/lib/souls.rb +1 -0
- 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: 72186fdb6eb5c908f3862bbc5951c4d898a18119c9c86f87ec62daa0930b6ca7
|
4
|
+
data.tar.gz: bc96b74682d102ea462ea98f6680e87c722a9a1b59fb232713820dafa6f08edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cdca5ac960e5be661ced4c27516b369339ccc27bd0c65de34da007fb5940b7d6bca942773de295d384230a09ae828b30bfe88d52c7bef394342bd40a1d85799
|
7
|
+
data.tar.gz: 5176d24f7839f3673a8ab22e057de99481a421f87e65b442f7147c8180bc8d188ca60cf6d01b424f7d20a114150592679a9c934356415a5bde353aea8137df47
|
@@ -8,21 +8,23 @@ 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
|
+
system("gcloud config set project #{project_id}")
|
16
17
|
system(
|
17
18
|
"gcloud sql instances create #{instance_name} \
|
18
19
|
--database-version=#{db_type} --cpu=1 --memory=4096MB --zone=#{zone} \
|
19
20
|
--root-password='#{password}' --database-flags cloudsql.iam_authentication=on"
|
20
21
|
)
|
22
|
+
instance_ip = `gcloud sql instances list | grep #{instance_name} | awk '{print $5}'`.strip
|
21
23
|
Dir.chdir(Souls.get_api_path.to_s) do
|
22
24
|
file_path = ".env"
|
23
25
|
File.open(file_path, "w") do |line|
|
24
26
|
line.write(<<~TEXT)
|
25
|
-
SOULS_DB_HOST=#{
|
27
|
+
SOULS_DB_HOST=#{instance_ip}
|
26
28
|
SOULS_DB_PW=#{password}
|
27
29
|
SOULS_DB_USER=postgres
|
28
30
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
@@ -36,7 +38,7 @@ module Souls
|
|
36
38
|
File.open(file_path, "w") do |line|
|
37
39
|
line.write(<<~TEXT)
|
38
40
|
SOULS_DB_HOST="/cloudsql/#{project_id}:#{region}:#{instance_name}"
|
39
|
-
SOULS_DB_PW=#{
|
41
|
+
SOULS_DB_PW=#{password}
|
40
42
|
SOULS_DB_USER=postgres
|
41
43
|
SOULS_APP_NAME=#{app_name}
|
42
44
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
@@ -133,10 +135,6 @@ module Souls
|
|
133
135
|
|
134
136
|
private
|
135
137
|
|
136
|
-
def get_sql_ip
|
137
|
-
`gcloud sql instances list | grep james | awk '{print $5}'`
|
138
|
-
end
|
139
|
-
|
140
138
|
def region_to_timezone(region: "asia-northeast1")
|
141
139
|
if region.include?("asia")
|
142
140
|
"Asia/Tokyo"
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.3
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.3
|
data/lib/souls.rb
CHANGED