-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (38 loc) · 9.88 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
namespace :db do
desc "Run migrations"
task :migrate, [:version] do |t, args|
require 'dotenv'
Dotenv.load ".env"
require "sequel"
Sequel.extension :migration
db = Sequel.connect(ENV.fetch("DATABASE_URL"))
if args[:version]
puts "Migrating to version #{args[:version]}"
Sequel::Migrator.run(db, "db/migrations", target: args[:version].to_i)
else
puts "Migrating to latest"
Sequel::Migrator.run(db, "db/migrations")
end
end
task :dev_seed do
require 'dotenv'
Dotenv.load '.env'
require './config/database'
require './app/models/init'
DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-06"), issue_count: 470, pull_request_count: 45); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-07"), issue_count: 467, pull_request_count: 44); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-08"), issue_count: 467, pull_request_count: 44); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-09"), issue_count: 468, pull_request_count: 42); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-10"), issue_count: 465, pull_request_count: 41); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-11"), issue_count: 461, pull_request_count: 41); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-12"), issue_count: 461, pull_request_count: 42); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-13"), issue_count: 463, pull_request_count: 45); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-14"), issue_count: 447, pull_request_count: 47); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-15"), issue_count: 451, pull_request_count: 49); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-16"), issue_count: 446, pull_request_count: 54); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-17"), issue_count: 435, pull_request_count: 48); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-18"), issue_count: 438, pull_request_count: 49); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-19"), issue_count: 442, pull_request_count: 50); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-20"), issue_count: 440, pull_request_count: 53); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-21"), issue_count: 450, pull_request_count: 53); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-22"), issue_count: 435, pull_request_count: 56); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-23"), issue_count: 435, pull_request_count: 54); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-24"), issue_count: 428, pull_request_count: 50); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-25"), issue_count: 428, pull_request_count: 50); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-26"), issue_count: 429, pull_request_count: 51); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-27"), issue_count: 422, pull_request_count: 48); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-28"), issue_count: 416, pull_request_count: 48); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-29"), issue_count: 411, pull_request_count: 48); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-30"), issue_count: 412, pull_request_count: 54); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-03-31"), issue_count: 413, pull_request_count: 53); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-04-01"), issue_count: 412, pull_request_count: 53); DailyStat.create(github_repo_id: 1, date: Date.parse("2018-04-02"), issue_count: 321, pull_request_count: 52)
DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-06"), issue_count:37, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-07"), issue_count:39, pull_request_count: 10); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-08"), issue_count:40, pull_request_count: 10); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-09"), issue_count:36, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-10"), issue_count:37, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-11"), issue_count:37, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-12"), issue_count:37, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-13"), issue_count:38, pull_request_count: 12); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-14"), issue_count:39, pull_request_count: 13); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-15"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-16"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-17"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-18"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-19"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-20"), issue_count:38, pull_request_count: 8); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-21"), issue_count:38, pull_request_count: 8); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-22"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-23"), issue_count:38, pull_request_count: 9); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-24"), issue_count:38, pull_request_count: 9); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-25"), issue_count:38, pull_request_count: 9); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-26"), issue_count:38, pull_request_count: 9); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-27"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-28"), issue_count:38, pull_request_count: 8); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-29"), issue_count:38, pull_request_count: 8); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-30"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-03-31"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-04-01"), issue_count:38, pull_request_count: 7); DailyStat.create(github_repo_id: 2, date: Date.parse("2018-04-02"), issue_count:38, pull_request_count: 7)
DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-06"), issue_count:39, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-07"), issue_count:36, pull_request_count: 12); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-08"), issue_count:36, pull_request_count: 12); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-09"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-10"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-11"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-12"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-13"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-14"), issue_count:41, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-15"), issue_count:43, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-16"), issue_count:43, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-17"), issue_count:43, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-18"), issue_count:43, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-19"), issue_count:43, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-20"), issue_count:44, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-21"), issue_count:44, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-22"), issue_count:44, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-23"), issue_count:44, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-24"), issue_count:45, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-25"), issue_count:45, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-26"), issue_count:45, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-27"), issue_count:45, pull_request_count: 10); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-28"), issue_count:45, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-29"), issue_count:45, pull_request_count: 11); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-30"), issue_count:29, pull_request_count: 8); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-03-31"), issue_count:29, pull_request_count: 8); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-04-01"), issue_count:29, pull_request_count: 8); DailyStat.create(github_repo_id: 3, date: Date.parse("2018-04-02"), issue_count:29, pull_request_count: 8)
end
end
namespace :garg do
desc "Run daily stats"
task :daily do |t, args|
require 'dotenv'
Dotenv.load ".env"
require "sequel"
Sequel.connect(ENV.fetch("DATABASE_URL"))
require 'sidekiq'
require_relative './workers/init'
ReposWorker.perform_async({})
end
end