Skip to content
代码片段 群组 项目
未验证 提交 5a082964 编辑于 作者: Rémy Coutable's avatar Rémy Coutable 提交者: GitLab
浏览文件

Merge branch 'pl-ci-strip-binaries' into 'master'

CI: Strip binaries produced by setup-test-env

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144872



Merged-by: default avatarRémy Coutable <remy@rymai.me>
Approved-by: default avatarRémy Coutable <remy@rymai.me>
Reviewed-by: default avatarRémy Coutable <remy@rymai.me>
Co-authored-by: default avatarPeter Leitzen <pleitzen@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -25,6 +25,7 @@ setup-test-env:
- section_start "setup-test-env" "Setting up testing environment"; scripts/setup-test-env; section_end "setup-test-env";
- select_gitlab_workhorse_essentials
- section_start "gitaly-test-build" "Compiling Gitaly binaries"; scripts/gitaly-test-build; section_end "gitaly-test-build"; # Do not use 'bundle exec' here
- strip_executable_binaries "${TMP_TEST_FOLDER}"
artifacts:
expire_in: 7d
paths:
......
......@@ -177,3 +177,11 @@ and `compile-production-assets` jobs to:
This task is responsible for deciding if assets need to be compiled or not.
It [compares the `HEAD` `SHA256` hexdigest from `$GITLAB_ASSETS_HASH` with the `master` hexdigest from `cached-assets-hash.txt`](https://gitlab.com/gitlab-org/gitlab/-/blob/c023191ef412e868ae957f3341208a41ca678403/lib/tasks/gitlab/assets.rake#L86).
1. If the hashes are the same, we don't compile anything. If they're different, we compile the assets.
## Stripped binaries
By default, `setup-test-env` creates an artifact which contains stripped
binaries to [save storage and speed-up artifact downloads](https://gitlab.com/gitlab-org/gitlab/-/issues/442029#note_1775193538) of subsequent CI jobs.
To make debugging a crash from stripped binaries easier comment line with
`strip_executable_binaries` in the `setup-test-job` job and start a new pipeline.
......@@ -91,6 +91,12 @@ function select_gitlab_workhorse_essentials() {
mv ${tmp_path} ${TMP_TEST_FOLDER}
}
function strip_executable_binaries() {
local path="$1"
find "$path" -executable -type f ! -size 0 -print0 | xargs -0 grep -IL . | xargs strip || true
}
# Assets functions
function gitlab_assets_archive_doesnt_exist() {
archive_doesnt_exist "${GITLAB_ASSETS_PACKAGE_URL}"
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册