souls 1.21.4 → 1.21.8

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: b7b2f32c521176dadc7f3a709c93860b002e619abb7fc6453c8c5a91c0a93fa3
4
- data.tar.gz: 87db4e9357f1eff27234ee063e886bfc8ffc1814d155a3bceb820192561403d9
3
+ metadata.gz: 2d5989b972bb93949215156aac0d1d35110eeb998419ded0cf31c1b4872ef06a
4
+ data.tar.gz: 5c81810f878ce4aabb7bc155ed1c4dfce05ca787ad47d45449440d3ca111b03b
5
5
  SHA512:
6
- metadata.gz: 51e12c13ee2e81d8b0537318be10fd7feb72f001a94e01bdb32535f6b882dff4e3a65e2252fb61a567fa56a1f9cb1238de35fca8d0a15d492f7e35aca60e5a67
7
- data.tar.gz: 9877d64d9578cb267fd61048762b037fc42a9a6e2100d46fa4dcda2e87644659cd9aff9b8378ea857252a9b111ea95aff36a35f4b32946011bb663f5f0b3b1b5
6
+ metadata.gz: c8e76007b148e35453bff8d0d16309f3b50f39c8b307bb7bb17fc717ca4a74eba870b0d83b86800c73091516234996546d65ff4978a3739cb6b774b8d6df7e7c
7
+ data.tar.gz: 14912f26822268f96d53a97e9fc916ddfc3c98501ac47044598fcf1f3158657f4e8f8a8d922ca76bcf8d632a412d575cae3ccd1f7dc5cc66fdb4d704c7377bc0
@@ -141,28 +141,31 @@ end
141
141
  - name: Set up Ruby 3.1
142
142
  uses: ruby/setup-ruby@v1
143
143
  with:
144
+ bundler-cache: true
144
145
  ruby-version: 3.1
145
146
 
146
147
  - name: Checkout the repository
147
148
  uses: actions/checkout@v2
148
149
 
149
- - name: GCP Authenticate
150
- uses: google-github-actions/setup-gcloud@master
150
+ - id: auth
151
+ uses: google-github-actions/auth@v0
151
152
  with:
152
- version: "323.0.0"
153
- project_id: ${{ secrets.SOULS_GCP_PROJECT_ID }}
154
- service_account_key: ${{ secrets.SOULS_GCP_SA_KEY }}
155
- export_default_credentials: true
153
+ credentials_json: ${{ secrets.SOULS_GCP_SA_KEY }}
154
+
155
+ - name: Set up Cloud SDK
156
+ uses: google-github-actions/setup-gcloud@v0
156
157
 
157
158
  - name: Build and test with Rake
158
159
  env:
159
160
  PGHOST: 127.0.0.1
160
161
  PGUSER: postgres
161
162
  RACK_ENV: test
163
+ RUBY_YJIT_ENABLE: 1
162
164
  SOULS_GCP_PROJECT_ID: ${{ secrets.SOULS_GCP_PROJECT_ID }}
163
165
  run: |
164
166
  sudo apt-get -yqq install libpq-dev
165
167
  cd apps/#{worker_name}
168
+ rm -f .env
166
169
  gem install bundler
167
170
  bundle install --jobs 4 --retry 3
168
171
  bundle exec rake db:create RACK_ENV=test
@@ -202,7 +205,8 @@ end
202
205
  --set-env-vars="SOULS_DB_HOST=${{ secrets.SOULS_DB_HOST }}" \\
203
206
  --set-env-vars="TZ=${{ secrets.TZ }}" \\
204
207
  --set-env-vars="SOULS_SECRET_KEY_BASE=${{ secrets.SOULS_SECRET_KEY_BASE }}" \\
205
- --set-env-vars="SOULS_GCP_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}"
208
+ --set-env-vars="SOULS_GCP_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}" \\
209
+ --set-env-vars="RUBY_YJIT_ENABLE=1"
206
210
  TEXT
207
211
  end
208
212
  SOULs::Painter.create_file(file_path.to_s)
@@ -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(&: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.4".freeze
2
+ VERSION = "1.21.8".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.21.4
1
+ 1.21.8
@@ -1 +1 @@
1
- 1.21.4
1
+ 1.21.8
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.4
4
+ version: 1.21.8
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