Commit b90f505703450f1469c7725c71f77a9102f996ff

Authored by Jacob Vosmaer
2 parents b4584bdc b4a5f6d2

Merge branch 'assets_precompile' into 'master'

Assets Precompile
config/patches/acts-as-taggable-on-ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e.diff 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +diff --git a/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb b/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  2 +index 6bec623..5227ddf 100644
  3 +--- a/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  4 ++++ b/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb
  5 +@@ -2,7 +2,7 @@ module ActsAsTaggableOn::Taggable
  6 + module Cache
  7 + def self.included(base)
  8 + # Skip adding caching capabilities if table not exists or no cache columns exist
  9 +- return unless base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }
  10 ++ return unless base.connected? && base.table_exists? && base.tag_types.any? { |context| base.column_names.include?("cached_#{context.to_s.singularize}_list") }
  11 +
  12 + base.send :include, ActsAsTaggableOn::Taggable::Cache::InstanceMethods
  13 + base.extend ActsAsTaggableOn::Taggable::Cache::ClassMethods
config/software/gitlab-core.rb
@@ -36,7 +36,27 @@ build do @@ -36,7 +36,27 @@ build do
36 # source code to include the Git revision of the code included in the omnibus 36 # source code to include the Git revision of the code included in the omnibus
37 # build. 37 # build.
38 command "sed -i 's/.*REVISION.*/REVISION = \"#{version_guid.split(':').last[0,10]}\"/' config/initializers/2_app.rb" 38 command "sed -i 's/.*REVISION.*/REVISION = \"#{version_guid.split(':').last[0,10]}\"/' config/initializers/2_app.rb"
  39 +
39 bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem" 40 bundle "install --without mysql development test --path=#{install_dir}/embedded/service/gem"
  41 +
  42 + # In order to precompile the assets, we need to get to a state where rake can
  43 + # load the Rails environment.
  44 + command "cp config/gitlab.yml.example config/gitlab.yml"
  45 + command "cp config/database.yml.postgresql config/database.yml"
  46 + # There is a bug in the acts-as-taggable-on gem that makes
  47 + # rake assets:precompile check for a database connection. We do not have a
  48 + # database at this point so that is a problem. This bug is fixed in
  49 + # acts-as-taggable-on 3.0.0 by
  50 + # https://github.com/mbleigh/acts-as-taggable-on/commit/ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e
  51 + patch = "#{Omnibus.project_root}/config/patches/acts-as-taggable-on-ad02dc9bb24ec8e1e79e7e35e2d4bb5910a66d8e.diff"
  52 + # To make this idempotent, we apply the patch (in case this is a first run) or
  53 + # we revert and re-apply the patch (if this is a second or later run).
  54 + command "git apply #{patch} || (git apply -R #{patch} && git apply #{patch})",
  55 + :cwd => "#{install_dir}/embedded/service/gem/ruby/1.9.1/gems/acts-as-taggable-on-2.4.1"
  56 + rake "assets:precompile", :env => {"RAILS_ENV" => "production"}
  57 + # Tear down now that the assets:precompile is done.
  58 + command "rm config/gitlab.yml config/database.yml"
  59 +
40 command "mkdir -p #{install_dir}/embedded/service/gitlab-core" 60 command "mkdir -p #{install_dir}/embedded/service/gitlab-core"
41 command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/" 61 command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/gitlab-core/"
42 block do 62 block do