Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
953d3b0b
Commit
953d3b0b
authored
Feb 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
318b8c99
5dc15b2a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
72 additions
and
16 deletions
+72
-16
.gitlab-ci.yml
.gitlab-ci.yml
+17
-8
config/initializers/sprockets_base_file_digest_key.rb
config/initializers/sprockets_base_file_digest_key.rb
+3
-0
lib/gitlab/patch/sprockets_base_file_digest_key.rb
lib/gitlab/patch/sprockets_base_file_digest_key.rb
+22
-0
lib/gitlab/task_helpers.rb
lib/gitlab/task_helpers.rb
+7
-1
lib/gitlab/utils/merge_hash.rb
lib/gitlab/utils/merge_hash.rb
+2
-0
lib/gitlab/utils/override.rb
lib/gitlab/utils/override.rb
+2
-0
lib/gitlab/utils/strong_memoize.rb
lib/gitlab/utils/strong_memoize.rb
+2
-0
lib/tasks/gitlab/assets.rake
lib/tasks/gitlab/assets.rake
+11
-7
scripts/clean-old-cached-assets
scripts/clean-old-cached-assets
+6
-0
No files found.
.gitlab-ci.yml
View file @
953d3b0b
...
...
@@ -509,20 +509,25 @@ flaky-examples-check:
-
scripts/merge-reports ${NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*_*.json
-
scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT
.assets-compile-cache
:
&assets-compile-cache
cache
:
key
:
"
assets-compile:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v3"
paths
:
-
vendor/ruby/
-
.yarn-cache/
-
tmp/cache/assets/sprockets
compile-assets
:
<<
:
*dedicated-runner
<<
:
*except-docs
<<
:
*use-pg
stage
:
prepare
cache
:
<<
:
*default-cache
script
:
-
node --version
-
date
-
yarn install --frozen-lockfile --cache-folder .yarn-cache
-
date
-
free -m
-
bundle exec rake gitlab:assets:compile
-
scripts/clean-old-cached-assets
variables
:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS
:
--max_old_space_size=3584
...
...
@@ -531,6 +536,7 @@ compile-assets:
paths
:
-
node_modules
-
public/assets
<<
:
*assets-compile-cache
setup-test-env
:
<<
:
*dedicated-runner
...
...
@@ -798,7 +804,9 @@ gitlab:setup-mysql:
gitlab:assets:compile:
<<
:
*dedicated-no-docs-pull-cache-job
image
:
dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.5.3-git-2.18-chrome-71.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1
dependencies
:
[]
dependencies
:
-
setup-test-env
-
compile-assets
services
:
-
docker:stable-dind
variables
:
...
...
@@ -812,18 +820,19 @@ gitlab:assets:compile:
DOCKER_DRIVER
:
overlay2
DOCKER_HOST
:
tcp://docker:2375
script
:
-
date
-
node --version
-
yarn install --frozen-lockfile --production --cache-folder .yarn-cache
-
date
-
free -m
-
bundle exec rake gitlab:assets:compile
-
scripts/build_assets_image
-
time scripts/build_assets_image
-
scripts/clean-old-cached-assets
artifacts
:
name
:
webpack-report
expire_in
:
31d
paths
:
-
webpack-report/
-
public/assets/
<<
:
*assets-compile-cache
only
:
-
//@gitlab-org/gitlab-ce
-
//@gitlab-org/gitlab-ee
...
...
config/initializers/sprockets_base_file_digest_key.rb
0 → 100644
View file @
953d3b0b
# frozen_string_literal: true
Sprockets
::
Base
.
prepend
(
Gitlab
::
Patch
::
SprocketsBaseFileDigestKey
)
lib/gitlab/patch/sprockets_base_file_digest_key.rb
0 → 100644
View file @
953d3b0b
# frozen_string_literal: true
# This monkey patch prevent cache ballooning when caching tmp/cache/assets/sprockets
# on the CI. See https://github.com/rails/sprockets/issues/563 and
# https://github.com/rails/sprockets/compare/3.x...jmreid:no-mtime-for-digest-key.
module
Gitlab
module
Patch
module
SprocketsBaseFileDigestKey
def
file_digest
(
path
)
if
stat
=
self
.
stat
(
path
)
digest
=
self
.
stat_digest
(
path
,
stat
)
integrity_uri
=
self
.
hexdigest_integrity_uri
(
digest
)
key
=
Sprockets
::
UnloadedAsset
.
new
(
path
,
self
).
file_digest_key
(
integrity_uri
)
cache
.
fetch
(
key
)
do
digest
end
end
end
end
end
end
lib/gitlab/task_helpers.rb
View file @
953d3b0b
# frozen_string_literal: true
require
'rainbow/ext/string'
require
'gitlab/utils/strong_memoize'
require
_dependency
'gitlab/utils/strong_memoize'
# rubocop:disable Rails/Output
module
Gitlab
...
...
@@ -13,6 +13,12 @@ module Gitlab
extend
self
def
invoke_and_time_task
(
task
)
start
=
Time
.
now
Rake
::
Task
[
task
].
invoke
puts
"`
#{
task
}
` finished in
#{
Time
.
now
-
start
}
seconds"
end
# Ask if the user wants to continue
#
# Returns "yes" the user chose to continue
...
...
lib/gitlab/utils/merge_hash.rb
View file @
953d3b0b
# frozen_string_literal: true
require_dependency
'gitlab/utils'
module
Gitlab
module
Utils
module
MergeHash
...
...
lib/gitlab/utils/override.rb
View file @
953d3b0b
# frozen_string_literal: true
require_dependency
'gitlab/utils'
module
Gitlab
module
Utils
module
Override
...
...
lib/gitlab/utils/strong_memoize.rb
View file @
953d3b0b
# frozen_string_literal: true
require_dependency
'gitlab/utils'
module
Gitlab
module
Utils
module
StrongMemoize
...
...
lib/tasks/gitlab/assets.rake
View file @
953d3b0b
namespace
:gitlab
do
namespace
:assets
do
desc
'GitLab | Assets | Compile all frontend assets'
task
compile:
[
'yarn:check'
,
'gettext:po_to_json'
,
'rake:assets:precompile'
,
'webpack:compile'
,
'fix_urls'
]
task
:compile
do
require_dependency
'gitlab/task_helpers'
%w[
yarn:check
gettext:po_to_json
rake:assets:precompile
webpack:compile
gitlab:assets:fix_urls
]
.
each
(
&
Gitlab
::
TaskHelpers
.
method
(
:invoke_and_time_task
))
end
desc
'GitLab | Assets | Clean up old compiled frontend assets'
task
clean:
[
'rake:assets:clean'
]
...
...
scripts/clean-old-cached-assets
0 → 100755
View file @
953d3b0b
#!/bin/bash
# Clean up cached files that are older than 1 week
find tmp/cache/assets/sprockets/
-type
f
-mtime
+7
-execdir
rm
--
"{}"
\;
du
-d
0
-h
tmp/cache/assets/sprockets |
cut
-f1
| xargs
-I
%
echo
"tmp/cache/assets/sprockets/ is currently %"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment