DevOps解决方案 > 5、制品与包管理配置

5、制品与包管理配置

本文档将介绍启用流水线后,将业务正在使用的制品与包管理工具关联至 TAPD。

制品与包管理依赖于已关联的持续集成服务,请确保您的业务环境已有符合条件的管理工具,目前支持基于 Nexus 的工具关联。

在持续集成服务中配置 Nexus

  1. 安装 【nexus-artifact-uploader】 插件。

    操作路径: 【系统管理】>【插件管理】>【可选插件】 ,搜索 nexus-artifact-uploader 插件并安装。

    image.png

  2. 使用【nexus-artifact-uploader】上传制品到nexus

    下面介绍FreeStyle和Pipeline 两种模式,如何通过nexus-artifact-uploade上传制品到Nexus中,以下仅为示例配置,请根据实际情况填写

    2.1 如使用FreeStyle project,则在Build Steps中选择【Nexus artifact uploader】并填写相关配置

    image.png

    示例配置:

    1. freeStyleJob('NexusArtifactUploaderJob') {
    2. steps {
    3. nexusArtifactUploader {
    4. nexusVersion('nexus2')
    5. protocol('http')
    6. nexusUrl('localhost:8080/nexus')
    7. groupId('sp.sd')
    8. version('2.4')
    9. repository('NexusArtifactUploader')
    10. credentialsId('44620c50-1589-4617-a677-7563985e46e1')
    11. artifact {
    12. artifactId('nexus-artifact-uploader')
    13. type('jar')
    14. classifier('debug')
    15. file('nexus-artifact-uploader.jar')
    16. }
    17. artifact {
    18. artifactId('nexus-artifact-uploader')
    19. type('hpi')
    20. classifier('debug')
    21. file('nexus-artifact-uploader.hpi')
    22. }
    23. }
    24. }
    25. }

    2.2 如使用Pipeline 则在pipeline中添加如下配置

    1. nexusArtifactUploader(
    2. nexusVersion: 'nexus3',
    3. protocol: 'http',
    4. nexusUrl: 'my.nexus.address',
    5. groupId: 'com.example',
    6. version: version,
    7. repository: 'RepositoryName',
    8. credentialsId: 'CredentialsId',
    9. artifacts: [
    10. [artifactId: projectName,
    11. classifier: '',
    12. file: 'my-service-' + version + '.jar',
    13. type: 'jar']
    14. ]
    15. )

在 TAPD 中查看构建制品

进入目标项目下的流水线应用,选择配置了包管理步骤的构建任务,即可查看构建产物信息。

image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值