souls 1.4.10 → 1.5.1

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: '08cc1c411069255bac7a97299c362167c4f5a1051305a973a5da901f9aabf488'
4
- data.tar.gz: 4d7d2f6a14c5e631be088991ed35bcd03aee3dcee8b21f00c7a0f3a020898cca
3
+ metadata.gz: 610ae84aae1c7d75c24a0362d9aa8d26d8db04f5fceb3156a89717c2a04d2f43
4
+ data.tar.gz: d7aa00e87059adc6c94669ae690ac2d44553d798518f9e4241d9539e391d1a9c
5
5
  SHA512:
6
- metadata.gz: 1d0cdba28abb50e703f9fc37d55b1c7acbdf49d459306f48d2f9d5c11797e0d12a4b338da73a1d4fa9be6602f229d817109a3e2ccfb899b1b53a0fbee0bd3bb2
7
- data.tar.gz: fdc5cd9b1e18a27737cd495520f1ed58522b44d74c30c748de057af68a31346f93dfbedcd541227361399a55a09ef28d151b6cc782aebedb259582e6ffcb004c
6
+ metadata.gz: d1e30d414c8464bdeff2abc95bd92a26f58f234e731ccba69dc034a010c1043150e62affd95309d1197cd418c2ebdbc51c31fba65a65268f2b2b77126b006f3e
7
+ data.tar.gz: dcc28cc09610d9263bd060290f6399017f6bad0c8b6962f01c1c226fda890d126b61dd83e6b9877a4ecbbc3cec6108b6e48084c707993704f999bf3be9998a55
@@ -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,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 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
22
+ sleep(5) until instance_ip.match?(Resolv::IPv4::Regex)
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=#{get_sql_ip.strip}
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=#{options[:root_password]}
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"
@@ -33,7 +33,7 @@ module Souls
33
33
  puts("before build")
34
34
  system("rake build")
35
35
  system("rake release")
36
- system("gsutil -m cp -r coverage gs://souls-bucket/souls-coverage")
36
+ system("gsutil -m -q cp -r coverage gs://souls-bucket/souls-coverage")
37
37
  Whirly.status = Paint["soul-v#{souls_new_ver} successfully updated!"]
38
38
  end
39
39
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.4.10".freeze
2
+ VERSION = "1.5.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.4.10
1
+ 1.5.1
@@ -1 +1 @@
1
- 1.4.10
1
+ 1.5.1
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.10
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI