souls 1.21.6 → 1.21.10

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: 972a8bdeb1d9b160c82b227b6146426ee424e68f1262f270eb9f5179f2ae6369
4
- data.tar.gz: 724896462fd307b485b0c0eec27569f19666689d8b467a815371f75bb3fe999c
3
+ metadata.gz: 182f9d4646667b3f0f4c8898eeda83bad785121e60f3cd61884423b5dc49c6ff
4
+ data.tar.gz: 2e008b33b65c65fe03dedadea27585eed4cfe7ed44c4c29947c71eac4c7e0e8a
5
5
  SHA512:
6
- metadata.gz: ff673d80d7d5102dd9021eb147615b5aa868f66b2b48dc740402d22613d1a3cfd53d2ec5935d7c6c97c729a53353e79687dbeb5b201c738b5343ca7e4cf9f407
7
- data.tar.gz: b45cef0111b882026c9cb915f0df726306447c6036f8d92acd98cad95652c0939cf974043d439e50970ce687e1bb476a63e56752d170211c4fad141ab663a553
6
+ metadata.gz: 542150eb3f93979798f4933f70c7b743c57d24f88f2a71ae7a52a0dcf3158758d5400f879bd3ab2b3ff283e9357cf62cf2ecc4a12890e8bb89d4ec342ca06284
7
+ data.tar.gz: d2bc75fa2d3b5f9fd988182f9e2e43d5ac24d9d10e18c95169389f7b9ff090d32f516eef1ed3364f23bac494ab8c6d6246b23545fb997920bf832c244c80982c
@@ -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,21 @@
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
+ project_id = SOULs.configuration.project_id
7
+ worker_names = SOULs.configuration.workers.map { |f| f[:name] }
8
+ services = ["souls-#{app_name}-api"]
9
+ worker_names.each { |worker| services << "souls-#{app_name}-#{worker}" }
10
+
11
+ prompt = TTY::Prompt.new
12
+ service = prompt.select("Select Service?", services)
13
+ cron = prompt.ask("Cron Schedule?", default: "every 10 mins")
14
+
15
+ url = SOULs::CloudRun.new.get_endpoint(service)
6
16
  system(
7
- "gcloud scheduler jobs create http #{app_name}-awake
8
- --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
17
+ "gcloud scheduler jobs create http #{app_name}-awake \
18
+ --schedule '#{cron}' --uri #{url} --project=#{project_id} --http-method GET"
9
19
  )
10
20
  end
11
21
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.21.6".freeze
2
+ VERSION = "1.21.10".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.21.6
1
+ 1.21.10
@@ -1 +1 @@
1
- 1.21.6
1
+ 1.21.10
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.6
4
+ version: 1.21.10
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