This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
/
Rakefile
61 lines (52 loc) · 1.93 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
# foreman is not included in the Gemfile, more context
# https://github.com/ddollar/foreman/pull/678#issuecomment-398211757
task :dev do
unless system("which foreman", out: File::NULL)
raise "`foreman` is now required for process management. `sudo gem install foreman`"
end
sh "foreman start -f Procfile.dev"
end
task :prod do
unless system("which foreman", out: File::NULL)
raise "`foreman` is now required for process management. `sudo gem install foreman`"
end
sh "foreman start"
end
task :dev_bootstrap do
unless system("which brew")
raise "`brew` is required. Please install brew. https://brew.sh/"
end
sh("bundle install")
sh("gem install foreman")
sh("brew install node") unless system("which npm")
sh("npm install")
sh("ln -sf ../../.pre-commit .git/hooks/pre-commit")
end
# It seems like mapping ports in Docker requires --host which can break hosting in VMs
# So we'll just keep some docker-specific tasks down here
namespace :docker do
desc "Run in a Docker container in production mode"
task :prod do
sh "bundle exec rackup --host 0.0.0.0 --port 8080 --env production"
end
desc "Run in a Docker container with debugging on, no pushes, and no restarting work to help test config stuff"
task :prod_test do
# rubocop:disable Metrics/LineLength
sh("FASTLANE_CI_ERB_CLIENT=1 DEBUG=1 FASTLANE_CI_DISABLE_REMOTE_STATUS_UPDATE=1 FASTLANE_CI_DISABLE_PUSHES=1 FASTLANE_CI_SKIP_RESTARTING_PENDING_WORK=1 bundle exec rackup --host 0.0.0.0 --port 8080 --env development")
# rubocop:enable Metrics/LineLength
end
desc "Bootstrap for running in a Docker container"
task :dev_bootstrap do
sh("bundle install")
sh("npm install")
end
end
task :generate_protos do
sh "bundle exec grpc_tools_ruby_protoc -I protos/ --ruby_out=./protos --grpc_out=./protos protos/*.proto"
end
begin
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task(default: :spec)
rescue LoadError
end