前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【GitLab CI/CD】:Releases & Package Registry

【GitLab CI/CD】:Releases & Package Registry

作者头像
WEBJ2EE
发布2021-01-04 14:55:53
1.7K0
发布2021-01-04 14:55:53
举报
文章被收录于专栏:WebJ2EEWebJ2EE
代码语言:javascript
复制
目录
1. Releases
    1.1. 用途
    1.2. 创建 release
    1.3. 删除 release
2. Package Registry
    2.1. 用途
    2.2. 启用 Package Registry 功能
    2.3. 查看 Package
    2.4. 发布 package
    2.5. 删除 package

1. Releases

1.1. 用途

To introduce a checkpoint in your source code history, you can assign a Git tag at the moment of release. However, in most cases, your users need more than just the raw source code. They need compiled objects or other assets output by your CI/CD system.

A GitLab Release is a snapshot of the source, build output, artifacts, and other metadata associated with a released version of your code.

You can create a GitLab release on any branch. When you create a release:

  • GitLab automatically archives source code and associates it with the release.
  • GitLab automatically creates a JSON file that lists everything in the release, so you can compare and audit releases. This file is called release evidence.
  • You can add release notes and a message for the tag associated with the release.

After you create a release, you can associate milestones with it, and attach release assets, like runbooks or packages.

示例:Releases

1.2. 创建 release

代码语言:javascript
复制
curl --header "Content-Type: application/json" 
     --header "JOB-TOKEN: $CI_JOB_TOKEN" 
     --data "{ \"name\": \"SEF-$CI_COMMIT_TAG\", 
               \"tag_name\": \"$CI_COMMIT_TAG\", 
               \"description\": \"Release SEF-$CI_COMMIT_TAG\", 
               \"assets\": { 
                    \"links\": [{ 
                          \"name\": \"patch-pc\", 
                          \"url\": \"${PATCH_PC_PACKAGE_URL}\", 
                          \"link_type\":\"package\" 
                      }] 
                  } 
              }" 
     --request POST "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases"

1.3. 删除 release

代码语言:javascript
复制
curl --request DELETE 
     --header "PRIVATE-TOKEN: xxxxxxx" 
     "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/1.7.02"

2. Package Registry?

2.1. 用途

The GitLab Package Registry acts as a private or public registry for a variety of common package managers. You can publish and share packages, which can be easily consumed as a dependency in downstream projects.

The Package Registry supports the following formats:

2.2. 启用 Package Registry 功能

2.3. 查看 Package

2.4. 发布 package

代码语言:javascript
复制
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" 
     --upload-file ./patch-muif.zip 
     ${CI_API_V4_URL}/projects/:id/packages/generic/:package_name/:package_version/:file_name

2.5. 删除 package

参考:

Releases: https://docs.gitlab.com/ee/user/project/releases/ Packages & Registries: https://docs.gitlab.com/ee/user/packages/


本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-12-29,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 WebJ2EE 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档