Skip to content

Commit 8b2cbbb

Browse files
committed
Load only static_yaml in 'bin/setup' for better on-boarding experiences
1 parent 908565f commit 8b2cbbb

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

bin/setup

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,21 @@ FileUtils.chdir APP_ROOT do
2929
puts "\n== Upserting application data =="
3030
system! 'bin/rails dojos:update_db_by_yaml'
3131
system! 'bin/rails dojo_event_services:upsert'
32-
33-
today = Time.now.in_time_zone('Tokyo').to_date
34-
from = (today - 90).strftime('%Y%m')
35-
to = today.prev_month.strftime('%Y%m')
36-
if ENV['DOORKEEPER_API_TOKEN']
37-
system! "bin/rails statistics:aggregation[#{from},#{to}]"
38-
system! 'bin/rails upcoming_events:aggregation'
39-
else
40-
puts doorkeeper_message
41-
system! "bin/rails statistics:aggregation[#{from},#{to},connpass]"
42-
system! "bin/rails statistics:aggregation[#{from},#{to},facebook]"
43-
system! 'bin/rails upcoming_events:aggregation[connpass]'
44-
end
32+
system! "bin/rails statistics:aggregation[-,-,static_yaml]"
33+
34+
#today = Time.now.in_time_zone('Tokyo').to_date
35+
#from = (today - 90).strftime('%Y%m')
36+
#to = today.prev_month.strftime('%Y%m')
37+
#if ENV['DOORKEEPER_API_TOKEN'] && ENV['FIXIE_URL']
38+
# system! "bin/rails statistics:aggregation[#{from},#{to}]"
39+
# system! 'bin/rails upcoming_events:aggregation'
40+
#elsif ENV['DOORKEEPER_API_TOKEN']
41+
# system! "bin/rails statistics:aggregation[#{from},#{to},connpass]"
42+
# system! "bin/rails statistics:aggregation[#{from},#{to},facebook]"
43+
# system! 'bin/rails upcoming_events:aggregation[connpass]'
44+
#else
45+
# puts event_services_message
46+
#end
4547

4648
puts "\n== Removing old logs and tempfiles =="
4749
system! "bin/rails log:clear tmp:clear"
@@ -54,18 +56,13 @@ FileUtils.chdir APP_ROOT do
5456
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
5557
end
5658

57-
def doorkeeper_message
59+
def event_services_message
5860
<<~MESSAGE
5961
60-
環境変数 DOORKEEPER_API_TOKEN が設定されていないため、
61-
Doorkeeper API を使ったイベント情報の取得をスキップします。
62-
63-
Doorkeeper のイベントを取得するためには、
64-
下記ページから Doorkeeper API Token を取得し、
65-
環境変数 DOORKEEPER_API_TOKEN に設定してください。
66-
https://manage.doorkeeper.jp/user/oauth/applications
67-
68-
環境変数設定後に、bin/setup を再実行してください!
62+
環境変数 DOORKEEPER_API_TOKEN と FIXIE_URL が設定されていないため、
63+
Doorkeeper API や connpass API を使ったイベント情報の取得をスキップします。
6964
65+
なお API 経由でイベント情報を取得しなくても、rails server は実行可能です。
66+
もし API 経由でイベント情報を取得したい場合は開発チームにご連絡ください。
7067
MESSAGE
7168
end

0 commit comments

Comments
 (0)