diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 21:08:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 21:08:15 +0300 |
commit | 23dda8d4edb3c0efeb34586969ce0c64e385f936 (patch) | |
tree | 7573726226f43c71edff707dda377ca3088d3477 /.gitlab | |
parent | bf6d126a58a66a11b2e4b9de89986174a1885105 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/ci/caching.gitlab-ci.yml | 9 | ||||
-rw-r--r-- | .gitlab/ci/frontend.gitlab-ci.yml | 19 | ||||
-rw-r--r-- | .gitlab/ci/global.gitlab-ci.yml | 7 | ||||
-rw-r--r-- | .gitlab/ci/review.gitlab-ci.yml | 2 |
4 files changed, 20 insertions, 17 deletions
diff --git a/.gitlab/ci/caching.gitlab-ci.yml b/.gitlab/ci/caching.gitlab-ci.yml index c7b8d49e9d1..92f70fea80d 100644 --- a/.gitlab/ci/caching.gitlab-ci.yml +++ b/.gitlab/ci/caching.gitlab-ci.yml @@ -23,20 +23,17 @@ cache-workhorse: .cache-assets-base: extends: - .compile-assets-base + - .ruby-node-cache - .caching:rules:cache-assets stage: prepare variables: WEBPACK_REPORT: "false" script: - !reference [.yarn-install, script] - - export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee assets-hash.txt) + - export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee cached-assets-hash.txt) - source scripts/gitlab_component_helpers.sh - 'gitlab_assets_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }' - # If we still use the legacy cache, we don't want to create a package from it as we don't check the sha sum in gitlab:assets:compile_with_new_strategy. - # This line can be removed once we stop downloading the legacy cache. - - rm -rf public/assets - - run_timed_command "bin/rake gitlab:assets:compile_with_new_strategy" - - run_timed_command "scripts/clean-old-cached-assets" + - run_timed_command "bin/rake gitlab:assets:compile" - run_timed_command "create_gitlab_assets_package" - run_timed_command "upload_gitlab_assets_package" diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index fc2bf5540e4..fa0fba54014 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -24,17 +24,15 @@ stage: prepare script: - !reference [.yarn-install, script] + - export GITLAB_ASSETS_HASH=$(bin/rake gitlab:assets:hash_sum) + - 'echo "CACHE_ASSETS_AS_PACKAGE: ${CACHE_ASSETS_AS_PACKAGE}"' + # The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable - | - # The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable if [[ "${CACHE_ASSETS_AS_PACKAGE}" == "true" ]]; then - export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee assets-hash.txt) source scripts/gitlab_component_helpers.sh - run_timed_command "download_and_extract_gitlab_assets" || true - run_timed_command "bin/rake gitlab:assets:compile_with_new_strategy" - else - run_timed_command "bin/rake gitlab:assets:compile" + gitlab_assets_archive_doesnt_exist || run_timed_command "download_and_extract_gitlab_assets" fi - - run_timed_command "scripts/clean-old-cached-assets" + - run_timed_command "bin/rake gitlab:assets:compile" compile-production-assets: extends: @@ -80,6 +78,9 @@ update-assets-compile-production-cache: - .assets-compile-cache-push - .shared:rules:update-cache stage: prepare + script: + - !reference [compile-production-assets, script] + - echo -n "${GITLAB_ASSETS_HASH}" > "cached-assets-hash.txt" artifacts: {} # This job's purpose is only to update the cache. update-assets-compile-test-cache: @@ -88,8 +89,12 @@ update-assets-compile-test-cache: - .assets-compile-cache-push - .shared:rules:update-cache stage: prepare + script: + - !reference [compile-test-assets, script] + - echo -n "${GITLAB_ASSETS_HASH}" > "cached-assets-hash.txt" artifacts: {} # This job's purpose is only to update the cache. +# TODO: Remove this as it's duplicating update-assets-compile-*-cache update-yarn-cache: extends: - .default-retry diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 9418d2462d3..e3b41dcfe4a 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -79,10 +79,10 @@ policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. .assets-cache: &assets-cache - key: "assets-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-node-${NODE_ENV}-v3" + key: "assets-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-node-${NODE_ENV}-v4" # This list should match GITLAB_ASSETS_PATHS_LIST from scripts/gitlab_component_helpers.sh paths: - - assets-hash.txt + - cached-assets-hash.txt - app/assets/javascripts/locale/**/app.js - public/assets/ - tmp/cache/assets/sprockets/ @@ -176,7 +176,7 @@ cache: - *ruby-gems-cache -.danger-review-cache: +.ruby-node-cache: cache: - *ruby-gems-cache - *node-modules-cache @@ -201,6 +201,7 @@ cache: - *node-modules-cache +# TODO: Remove this as it's duplicating .assets-compile-cache-push .yarn-cache-push: cache: - *node-modules-cache-push diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index 46e62829394..9bfa7ccc36b 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -72,7 +72,7 @@ review-app-test-results: danger-review: extends: - .default-retry - - .danger-review-cache + - .ruby-node-cache - .review:rules:danger stage: test needs: [] |