Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
93b942ec
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93b942ec
编写于
1月 21, 2016
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor build artifacts documentation
[ci skip]
上级
36aa3e61
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
175 addition
and
52 deletion
+175
-52
doc/README.md
doc/README.md
+1
-1
doc/ci/README.md
doc/ci/README.md
+1
-1
doc/ci/artifacts/README.md
doc/ci/artifacts/README.md
+0
-50
doc/ci/build_artifacts/README.md
doc/ci/build_artifacts/README.md
+173
-0
doc/ci/build_artifacts/img/build_artifacts_browser.png
doc/ci/build_artifacts/img/build_artifacts_browser.png
+0
-0
doc/ci/build_artifacts/img/build_artifacts_browser_button.png
...ci/build_artifacts/img/build_artifacts_browser_button.png
+0
-0
未找到文件。
doc/README.md
浏览文件 @
93b942ec
...
...
@@ -30,7 +30,7 @@
-
[
User permissions
](
ci/permissions/README.md
)
-
[
API
](
ci/api/README.md
)
-
[
Triggering builds through the API
](
ci/triggers/README.md
)
-
[
Build artifacts
](
ci/artifacts/README.md
)
-
[
Build artifacts
](
ci/
build_
artifacts/README.md
)
### CI Languages
...
...
doc/ci/README.md
浏览文件 @
93b942ec
...
...
@@ -12,7 +12,7 @@
*
[
Using Variables
](
variables/README.md
)
*
[
Using SSH keys
](
ssh_keys/README.md
)
*
[
Triggering builds through the API
](
triggers/README.md
)
*
[
Build artifacts
](
artifacts/README.md
)
*
[
Build artifacts
](
build_
artifacts/README.md
)
### Languages
...
...
doc/ci/artifacts/README.md
已删除
100644 → 0
浏览文件 @
36aa3e61
# Build artifacts
Since version 8.2 of GitLab and version 0.7.0 of GitLab Runner, build artifacts
created by GitLab Runner are uploaded to GitLab, and then you can download
artifacts archive using GitLab UI.
Since version 8.4 of GitLab and version 1.0 of GitLab Runner artifacts are
compressed using ZIP format and it is possible to browse content of such an
archive using GitLab UI, and then download a single file from inside it.
## Artifacts in .gitlab-ci.yml
Please look into
`.gitlab-ci.yml`
[
documentation
](
../yaml/README.md
)
.
## Artifacts archive format
Prior to version 8.4 of GitLab and 1.0 of GitLab Runner, build artifacts were
compressed using
`tar.gz`
format.
Since then, we use a ZIP format.
## How build artifacts are stored
After a successful build, GitLab Runner uploads an archive containing build
artifacts to GitLab. This archive is not extracted after that, so its save a
storage space.
## How do we access content of an artifacts archive
When GitLab receives an artifacts archive, archive metadata file is being
generated. Metadata file describes all entries that are located in artifacts
archive. This file is in a binary format, with additional GZIP compression.
It is possible then to browse artifacts using GitLab UI and artifacts browser.
TODO IMG
GitLab does not extract artifacts archive to make it possible to browse it. We
use artifacts metadata file instead that contains are relevant information.
This is especially important when there is a lot of artifacts, or an archive is
a very large file.
## How do we make files downloadable
When user clicks a regular file, then download of this particular file starts.
GitLab does not extract entire artifacts archive to send a single file to user.
Instead of extracting entire file, only one file is being extracted. It is not
necessary to extract large archive, just to download a small file that is
inside.
doc/ci/build_artifacts/README.md
0 → 100644
浏览文件 @
93b942ec
# Introduction to build artifacts
Artifacts is a list of files and directories which are attached to a build
after it completes successfully.
Since GitLab 8.2 and [GitLab Runner] 0.7.0, build artifacts that are created by
GitLab Runner are uploaded to GitLab and are downloadable as a single archive
(
`tar.gz`
) using the GitLab UI.
Starting from GitLab 8.4 and GitLab Runner 1.0, the artifacts archive format
changed to
`ZIP`
, and it is now possible to browse its contents, with the added
ability of downloading the files separately.
## Enabling build artifacts
If you are searching for ways to use the artifacts feature, jump to
[
Defining artifacts in `.gitlab-ci.yml`
](
#defining-artifacts-in-gitlab-ciyml
)
.
The artifacts feature is enabled by default in all GitLab installations.
If by any chance you want to disable the artifacts feature on your GitLab
instance, follow the steps below.
---
**In Omnibus installations:**
1.
Edit
`/etc/gitlab/gitlab.rb`
and add the following line:
```ruby
gitlab_rails['artifacts_enabled'] = false
```
1.
Save the file and
[
reconfigure GitLab
][]
for the changes to take effect.
---
**In installations from source:**
1.
Edit
`/home/git/gitlab/config/gitlab.yml`
and add or amend the following lines:
```yaml
artifacts:
enabled: false
```
1.
Save the file and
[
restart GitLab
][]
for the changes to take effect.
## Defining artifacts in `.gitlab-ci.yml`
A simple example of using the artifacts definition in
`.gitlab-ci.yml`
would be
the following:
```
yaml
pdf
:
script
:
xelatex mycv.tex
artifacts
:
paths
:
-
mycv.pdf
```
A job named
`pdf`
calls the
`xelatex`
command in order to build a pdf file from
the latex source file
`mycv.tex`
. We then define the
`artifacts`
paths which in
turn are defined with the
`paths`
keyword. All paths to files and directories
are relative to the repository that was cloned during the build.
For more examples on artifacts, follow the
[
separate artifacts yaml documentation
](
../yaml/README.md#artifacts
)
.
## Storing build artifacts
After a successful build, GitLab Runner uploads an archive containing the build
artifacts to GitLab.
To change the location where the artifacts are stored, follow the steps below.
---
**In Omnibus installations:**
_The artifacts are stored by default in
`/var/opt/gitlab/gitlab-rails/shared/artifacts`
._
1.
To change the storage path for example to
`/mnt/storage/artifacts`
, edit
`/etc/gitlab/gitlab.rb`
and add the following line:
```ruby
gitlab_rails['artifacts_path'] = "/mnt/storage/artifacts"
```
1.
Save the file and
[
reconfigure GitLab
][]
for the changes to take effect.
---
**In installations from source:**
_The artifacts are stored by default in
`/home/git/gitlab/shared/artifacts`
._
1.
To change the storage path for example to
`/mnt/storage/artifacts`
, edit
`/home/git/gitlab/config/gitlab.yml`
and add or amend the following lines:
```yaml
artifacts:
enabled: true
path: /mnt/storage/artifacts
```
1.
Save the file and
[
restart GitLab
][]
for the changes to take effect.
## Browsing build artifacts
When GitLab receives an artifacts archive, an archive metadata file is also
generated. This metadata file describes all the entries that are located in the
artifacts archive itself. The metadata file is in a binary format, with
additional GZIP compression.
GitLab does not extract the artifacts archive in order to save space, memory
and disk I/O. It instead inspects the metadata file which contains all the
relevant information. This is especially important when there is a lot of
artifacts, or an archive is a very large file.
---
After a successful build, if you visit the build's specific page, you can see
that there are two buttons.
One is for downloading the artifacts archive and the other for browsing its
contents.
![
Build artifacts browser button
](
img/build_artifacts_browser_button.png
)
---
The archive browser shows the name and the actual file size of each file in the
archive. If your artifacts contained directories, then you are also able to
browse inside them.
Below you can see an image of three different file formats, as well as two
directories.
![
Build artifacts browser
](
img/build_artifacts_browser.png
)
---
## Downloading build artifacts
If you need to download the whole archive, there are buttons in various places
inside GitLab that make that possible.
1.
While on the builds page, you can see the download icon for each build's
artifacts archive in the right corner
1.
While inside a specific build, you are presented with a download button
along with the one that browses the archive
1.
And finally, when browsing and archive you can see the download button at
the top right corner
---
Note that GitLab does not extract the entire artifacts archive to send just a
single file to the user.
When clicking on a specific file, [GitLab Workhorse] extracts it from the
archive and the download begins.
This implementation saves space, memory and disk I/O.
[
gitlab runner
]:
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner
"GitLab Runner repository"
[
reconfigure gitlab
]:
../../administration/restart_gitlab.md
"How to restart GitLab documentation"
[
restart gitlab
]:
../../administration/restart_gitlab.md
"How to restart GitLab documentation"
[
gitlab workhorse
]:
https://gitlab.com/gitlab-org/gitlab-workhorse
"GitLab Workhorse repository"
doc/ci/build_artifacts/img/build_artifacts_browser.png
0 → 100644
浏览文件 @
93b942ec
87.0 KB
doc/ci/build_artifacts/img/build_artifacts_browser_button.png
0 → 100644
浏览文件 @
93b942ec
11.3 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录