souls 1.21.7 → 1.21.11

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: 51029691bed806a3fc05b0ca3f46eb46bff7bf55aecf8edf74dab886f7d0d8db
4
- data.tar.gz: daaa33d1f79ffb651a5c4b455f1b35486cee2394f2b18e3aa9caa1b273991cb3
3
+ metadata.gz: 530e62c8938e2f868a72b479c21efbc85d74aeea10e445fc3ade9506d06ae7bd
4
+ data.tar.gz: 6c8ac7ecff385de4085d2c3c3181b80090803504e837fa05cf97e2f40691416f
5
5
  SHA512:
6
- metadata.gz: 94c8a575b31e6460ef4a00a4ef0507f15b4d91cb514e5d66432f12a263f59677d754e71192bb48cf415bda31880607364a97fe5bd0f31d12c0673ee2322e000c
7
- data.tar.gz: 57e33b7c5a4aabf42f340fdc0df5918ad1b26da7777383ab8643b8242db7edecc8d9fec8f2624bde2cfe4999c6de4b92874d7fb40dcefc74587d9bfe9ad25a67
6
+ metadata.gz: 4cb49553f3386356b5917b7d7684f4ad13a03e201e4b858eea4804b56847b9fa720995d2f57fba121eb0255fef036cb428dfcb02359bd80f61abb414803512b5
7
+ data.tar.gz: 59076c8b8a6167ca47b5dea557f490fc8a31fb08117341b80d448fcfe22295fb03b6de65fd098c8dbacbf18b457804e4ff2b2044431eddea253095def18b0acf
@@ -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.7".freeze
2
+ VERSION = "1.21.11".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.21.7
1
+ 1.21.11
@@ -1 +1 @@
1
- 1.21.7
1
+ 1.21.11
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.7
4
+ version: 1.21.11
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-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport