-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
38 lines (32 loc) · 927 Bytes
/
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
# frozen_string_literal: true
require "decidim/dev/common_rake"
require "fileutils"
def install_module(path)
Dir.chdir(path) do
system("bundle exec rake decidim_ub:install:migrations")
system("bundle exec rake db:migrate")
end
end
def install_initializer(path, env)
Dir.chdir(path) do
FileUtils.cp(
"#{__dir__}/lib/generators/decidim/app_templates/#{env}/initializer.rb",
"config/initializers/decidim_ub_config.rb"
)
end
end
def seed_db(path)
Dir.chdir(path) do
system("bundle exec rake db:seed")
end
end
desc "Generates a dummy app for testing"
task test_app: "decidim:generate_external_test_app" do
ENV["RAILS_ENV"] = "test"
install_initializer("spec/decidim_dummy_app", "test")
install_module("spec/decidim_dummy_app")
end
desc "Generates a development app."
task development_app: "decidim:generate_external_development_app" do
install_module("development_app")
end