diff options
| author | Luc Donnet | 2018-05-23 15:37:59 +0200 | 
|---|---|---|
| committer | GitHub | 2018-05-23 15:37:59 +0200 | 
| commit | 599645b4912e6ef8e37e60bb1276bfd732922955 (patch) | |
| tree | 7d751238011f4e374ec06a560d910e3ac77c6f95 /lib/tasks/ci.rake | |
| parent | 90e5289f48fa840567b8b758ebc4d0c90c5ddf47 (diff) | |
| parent | be00de83a41c91e317b0c1b8df5a70901cc9dcee (diff) | |
| download | chouette-core-599645b4912e6ef8e37e60bb1276bfd732922955.tar.bz2 | |
Merge pull request #568 from af83/6996-dockerfile-build
6996 - Dockerfile for build
Diffstat (limited to 'lib/tasks/ci.rake')
| -rw-r--r-- | lib/tasks/ci.rake | 26 | 
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 | 
