-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
57 lines (51 loc) · 1.45 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
# frozen_string_literal: true
require "decidim/dev/common_rake"
def install_module(path)
ENV["accountability_simple"] = ""
Dir.chdir(path) do
system("bundle exec rails decidim_favorites:install:migrations")
system("bundle exec rails decidim_locations:install:migrations")
system("bundle exec rails decidim_tags:install:migrations")
system("bundle exec rails decidim_nav:install:migrations")
system("bundle exec rails decidim_apifiles:install:migrations")
system("bundle exec rails decidim_accountability_simple:install:migrations")
system("bundle exec rails db:migrate")
system("npm i '@tarekraafat/autocomplete.js@<=10.2.7'")
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 do
ENV["accountability_simple"] = "create_app"
ENV["RAILS_ENV"] = "test"
generate_decidim_app(
"spec/decidim_dummy_app",
"--app_name",
"#{base_app_name}_test_app",
"--path",
"../..",
"--recreate_db",
"--skip_gemfile",
"--demo"
)
install_module("spec/decidim_dummy_app")
end
desc "Generates a development app"
task :development_app do
ENV["accountability_simple"] = "create_app"
generate_decidim_app(
"development_app",
"--app_name",
"#{base_app_name}_development_app",
"--path",
"..",
"--recreate_db",
"--demo"
)
install_module("development_app")
seed_db("development_app")
end