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: e66a13420316392b4b913b18b0352ed38df204993a6f85de7c2dd49404459b30
4
- data.tar.gz: a86643dbd67d217b146f01623627f38729b7027d3983c6bd7a5e8e5bf4df9d50
3
+ metadata.gz: 4b723d5fe6fdbb86fb785d308781dc7d0c5a13fcf6db3e714141a4d97c03d9d9
4
+ data.tar.gz: aa7ba7e1d4848499fa60ce609fada98d04167890f45275e485e1abe385a2fb36
5
5
  SHA512:
6
- metadata.gz: 6ccfe8988855e7a467a02ae39874d4f56868f7a0077c3bb69b359d8e32dd0f9953f307841ca24341c442d6a0c43e6cd960f29ca8d042ffa5199467355504eb44
7
- data.tar.gz: bae7c03ca1dd9feefcd21098e5b552a08362317d3b7dba2c87576024bcf65c762d1dd4b441c388f6bd6a3143ab1197455be5f5c5eb1a20ad1c33a25fca888097
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 if instance_name.blank?
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=3750MB --zone=#{zone} \
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=#{get_sql_ip.strip}
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=#{options[:root_password]}
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.4.11".freeze
2
+ VERSION = "1.5.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.4.11
1
+ 1.5.2
@@ -1 +1 @@
1
- 1.4.11
1
+ 1.5.2
data/lib/souls.rb CHANGED
@@ -9,6 +9,7 @@ require "paint"
9
9
  require "whirly"
10
10
  require "tty-prompt"
11
11
  require "thor"
12
+ require "resolv"
12
13
 
13
14
  module Souls
14
15
  extend Souls::Utils
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: 1.4.11
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI