souls 1.21.5 → 1.21.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da74fd1f249bf93d37466e7871c56fd5f13a287bfa37a84f74b01130f9e354a9
4
- data.tar.gz: 1b12042fb2aff0c9db27d243c0394c41627a0142c9c9b47f263674429966f6f3
3
+ metadata.gz: 1cd807f4db6dbc1d398cfb9f62c2d8c3f31f1cddd0d6861114e0ba612294d344
4
+ data.tar.gz: 46e73736e7402312e43a2afb60c768f7ad2d4f2725050ea016a7cc8b0695e6cc
5
5
  SHA512:
6
- metadata.gz: 95c4ed5426ae611ae9c09f710dc86051b78b30db59468a94ef7b4874906551f8c085eda316942f6f3b666f10429da092e5275817276abb8e32923469ab1f0303
7
- data.tar.gz: 917901a03e337ac0e74ba5f6c8b06f0539da11a257cc05c134d8cc2fce6d39bfdf0cbbcc90c71664158c236e4854a133663a5e037fd17f5fd469e5022999bfeb
6
+ metadata.gz: 6fa72844bec0cb42baabe68cc55a7df9f873adb9b601cd3026830b89fb0d2e483f334fa256a0ffc9a6d114607a26fa5788975885c3ea89c90326c6e40b07e90a
7
+ data.tar.gz: cd57323fa304ca071bdc27e882349262b4c3f79adde614e0016c5e92d8820eab341aa410cc85096136abc89af08f9c557769bd97af417246ae138bacb6b415f4
@@ -165,7 +165,7 @@ end
165
165
  run: |
166
166
  sudo apt-get -yqq install libpq-dev
167
167
  cd apps/#{worker_name}
168
- rm .env
168
+ rm -f .env
169
169
  gem install bundler
170
170
  bundle install --jobs 4 --retry 3
171
171
  bundle exec rake db:create RACK_ENV=test
@@ -5,9 +5,9 @@ module SOULs
5
5
  system("gcloud run services list --platform managed")
6
6
  end
7
7
 
8
- desc "get_endpoint", "Show Worker's Endpoint"
9
- def get_endpoint(worker_name: "")
10
- `gcloud run services list --platform managed | grep #{worker_name} | awk '{print $4}'`
8
+ desc "get_endpoint [service_name]", "Show Worker's Endpoint"
9
+ def get_endpoint(service_name)
10
+ `gcloud run services list --platform managed | grep #{service_name} | awk '{print $4}'`
11
11
  end
12
12
  end
13
13
  end
@@ -1,11 +1,20 @@
1
1
  module SOULs
2
2
  class CloudScheduler < Thor
3
- desc "awake [url]", "Set Ping Every 15min by Google Cloud Scheduler"
4
- def awake(url)
5
- app_name = SOULs.configuration.app
3
+ desc "awake [url]", "Set Ping by Google Cloud Scheduler: Cron e.g. '0 10 * * *' or 'every 10 hours'"
4
+ def awake
5
+ app_name = SOULs.configuration.app.gsub("_", "-")
6
+ worker_names = SOULs.configuration.workers.map { |f| f[:name] }
7
+ services = ["souls-#{app_name}-api"]
8
+ worker_names.each { |worker| services << "souls-#{app_name}-#{worker}" }
9
+
10
+ prompt = TTY::Prompt.new
11
+ service = prompt.select("Select Service?", services)
12
+ cron = prompt.ask("Cron Schedule?", default: "every 10 mins")
13
+
14
+ url = SOULs::GcloudRun.new.get_endpoint(service)
6
15
  system(
7
- "gcloud scheduler jobs create http #{app_name}-awake
8
- --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
16
+ "gcloud scheduler jobs create http #{app_name}-awake \
17
+ --schedule '#{cron}' --uri #{url} --http-method GET"
9
18
  )
10
19
  end
11
20
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.21.5".freeze
2
+ VERSION = "1.21.9".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.21.5
1
+ 1.21.9
@@ -1 +1 @@
1
- 1.21.5
1
+ 1.21.9
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.21.5
4
+ version: 1.21.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-01-18 00:00:00.000000000 Z
13
+ date: 2022-01-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport