Skip to content

Commit a6fe72d

Browse files
balasankarcderiamis
andcommitted
Merge branch '8197-switch-from-gzip-compression-to-xz-compression-for-packages' into 'master'
Switch from gzip compression to xz compression for packages Closes #8197 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7128 Merged-by: Balasankar 'Balu' C <[email protected]> Approved-by: Mitchell Nielsen <[email protected]> Approved-by: Clemens Beck <[email protected]> Approved-by: Balasankar 'Balu' C <[email protected]> Reviewed-by: Clemens Beck <[email protected]> Co-authored-by: Ryan Egesdahl <[email protected]>
2 parents fbf1683 + 58ab1f3 commit a6fe72d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

config/projects/gitlab.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,25 @@
273273
package :rpm do
274274
vendor 'GitLab, Inc. <[email protected]>'
275275
signing_passphrase Gitlab::Util.get_env('GPG_PASSPHRASE')
276+
277+
# Enable XZ compression if selected
278+
compress_xz = Gitlab::Util.get_env('COMPRESS_XZ') || 'false'
279+
if compress_xz == 'true'
280+
compression_type :xz
281+
compression_level 6
282+
end
276283
end
277284

278285
package :deb do
279286
vendor 'GitLab, Inc. <[email protected]>'
280287
signing_passphrase Gitlab::Util.get_env('GPG_PASSPHRASE')
288+
289+
# Enable XZ compression if selected
290+
compress_xz = Gitlab::Util.get_env('COMPRESS_XZ') || 'true'
291+
if compress_xz == 'true'
292+
compression_type :xz
293+
compression_level 6
294+
end
281295
end
282296

283297
resources_path "#{Omnibus::Config.project_root}/resources"

doc/build/build_package.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ project's [Container Registry](https://gitlab.com/gitlab-org/gitlab-omnibus-buil
6464
export COMPILE_ASSETS=true
6565
```
6666

67+
1. By default, XZ compression is used to produce the final DEB package,
68+
which reduces the package size by nearly 30% in comparison to Gzip, with
69+
little to no increase in build time. However, the system's package
70+
manager must also support the format. If your system's package manager does
71+
not support XZ packages, set the `COMPRESS_XZ` environment variable to `false`:
72+
73+
```shell
74+
export COMPRESS_XZ=false
75+
```
76+
77+
NOTE: This is feature is disabled by default on RPM platforms due to an
78+
as-yet-unexplained increase in packaging time. It can be enabled by setting
79+
the `COMPRESS_XZ` environment variable to `true`.
80+
6781
1. Install the libraries and other dependencies:
6882

6983
```shell

0 commit comments

Comments
 (0)