Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/gitlab/assets.rake')
-rw-r--r--lib/tasks/gitlab/assets.rake11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/assets.rake b/lib/tasks/gitlab/assets.rake
index 8eae36008fd..5d6d395037c 100644
--- a/lib/tasks/gitlab/assets.rake
+++ b/lib/tasks/gitlab/assets.rake
@@ -16,6 +16,13 @@ module Tasks
babel.config.js
config/webpack.config.js
].freeze
+ # Ruby gems might emit assets which have an impact on compilation
+ # or have a direct impact on asset compilation (e.g. scss) and therefore
+ # we should compile when these change
+ RAILS_ASSET_FILES = %w[
+ Gemfile
+ Gemfile.lock
+ ].freeze
EXCLUDE_PATTERNS = %w[
app/assets/javascripts/locale/**/app.js
].freeze
@@ -48,6 +55,9 @@ module Tasks
Digest::SHA256.hexdigest(assets_sha256).tap { |sha256| puts "=> SHA256 generated in #{Time.now - start_time}: #{sha256}" if verbose }
end
+ # Files listed here should match the list in:
+ # .assets-compilation-patterns in .gitlab/ci/rules.gitlab-ci.yml
+ # So we make sure that any impacting changes we do rebuild cache
def self.assets_impacting_compilation
assets_folders = FOSS_ASSET_FOLDERS
assets_folders += EE_ASSET_FOLDERS if ::Gitlab.ee?
@@ -55,6 +65,7 @@ module Tasks
asset_files = Dir.glob(JS_ASSET_PATTERNS)
asset_files += JS_ASSET_FILES
+ asset_files += RAILS_ASSET_FILES
assets_folders.each do |folder|
asset_files.concat(Dir.glob(["#{folder}/**/*.*"]))