aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/ci.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/ci.rake')
-rw-r--r--lib/tasks/ci.rake26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index 0723e4ccb..7ef867b71 100644
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -14,10 +14,19 @@ namespace :ci do
desc "Prepare CI build"
task :setup do
- cp "config/database.yml", "config/database.yml.orig"
- cp "config/database/ci.yml", "config/database.yml"
- puts "Use #{database_name} database"
+ unless ENV["IGNORE_YARN_INSTALL"]
+ # FIXME remove this specific behavior
+ # Managed by Dockerfile.build
+ sh "yarn --frozen-lockfile install"
+ end
+
+ unless ENV["KEEP_DATABASE_CONFIG"]
+ # FIXME remove this specific behavior
+ cp "config/database.yml", "config/database.yml.orig"
+ cp "config/database/ci.yml", "config/database.yml"
+ end
+ puts "Use #{database_name} database"
if parallel_tests?
sh "RAILS_ENV=test rake parallel:drop parallel:create parallel:migrate"
else
@@ -25,6 +34,15 @@ namespace :ci do
end
end
+ task :fix_webpacker do
+ # Redefine webpacker:yarn_install to avoid --production
+ # in CI process
+ Rake::Task["webpacker:yarn_install"].clear
+ Rake::Task.define_task "webpacker:yarn_install" do
+ puts "Don't run yarn"
+ end
+ end
+
def git_branch
if ENV['GIT_BRANCH'] =~ %r{/(.*)$}
$1
@@ -52,7 +70,7 @@ namespace :ci do
end
task :assets do
- sh "RAILS_ENV=test bundle exec rake assets:precompile i18n:js:export"
+ sh "RAILS_ENV=test bundle exec rake ci:fix_webpacker assets:precompile i18n:js:export"
end
task :jest do