-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
64 lines (55 loc) · 1.61 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'bundler/setup'
load 'tasks/otr-activerecord.rake'
begin
require 'annotate'
Annotate.set_defaults(
position_in_class: :after,
exclude_tests: true,
exclude_fixtures: true,
exclude_factories: true,
exclude_serializers: true
)
Annotate.load_tasks
rescue LoadError
# ignored
end
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task default: :spec
rescue LoadError
# ignored
end
task :environment do
require_relative 'application'
end
namespace :db do
task environment: :environment
end
namespace :workers do
task s3_raw: :environment do
Workers::S3Raw.new(
ENV.fetch('S3_RAW_INPUT_QUEUE_URL', 'https://sqs.us-west-2.amazonaws.com/985752656544/ingest-measurements-to-s3-raw-dev'),
ENV.fetch('S3_RAW_OUTPUT_BUCKET_NAME', 'safecastdata-us-west-2'),
ENV.fetch('S3_RAW_OBJECT_PREFIX', 'ingest/dev/s3raw')
).run
end
task elastic_cloud: :environment do
Workers::ElasticCloud.new(
ENV.fetch('ELASTIC_CLOUD_INPUT_QUEUE_URL', 'https://sqs.us-west-2.amazonaws.com/985752656544/ingest-measurements-to-elasticcloud-dev'),
ENV.fetch('ELASTIC_CLOUD_OUTPUT_CLUSTER_URL')
).run
end
end
%i(dev prd).each do |environment_name|
%i(ssh deploy).each do |action|
desc "#{action} to #{environment_name}"
task "#{action}_#{environment_name}" do
exec "eb #{action} safecastingest-#{environment_name} --profile safecast"
end
desc "#{action} to #{environment_name}-wrk"
task "#{action}_#{environment_name}_wrk" do
exec "eb #{action} safecastingest-#{environment_name}-wrk --profile safecast"
end
end
end