Jenkins可以自动检测并在git仓库中创建新创建的标签吗? [英] Is it possible for Jenkins to automatically detect and build newly created tags in a git repo?

查看:202
本文介绍了Jenkins可以自动检测并在git仓库中创建新创建的标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这可能吗?

这是可能的吗?

通过以下配置,您可以创建所有标签:

解决方案

ol>

  • 将作业提取标签设置为分支:单击资源库URL下方的高级按钮并输入Refspec + refs / tags / *:refs / remotes / origin / tags / *

  • 使用Branch Specifier * / tags / * 启用SCM轮询,以便作业检测到新的标签。



  • 方法有一个缺点:作业将建立所有标签,而不仅仅是新添加的标签。所以创建作业后,每个现有标签都会触发一次。所以你可能希望这个工作一开始不做任何事情,然后等待所有现有的标签都被处理完毕,然后只配置你想为每个新标签完成的构建步骤。



    由于标签在git中没有改变,因此只会为每个新标签触发一次作业。


    It would be nice for our Jenkins CI server to automatically detect, deploy and build tags as they are created in our Github repository.

    Is this possible?

    解决方案

    With the following configuration, you can make a job build all tags:

    1. Make the job fetch tags as if they were branches: Click on the Advanced button below the repository URL and enter the Refspec +refs/tags/*:refs/remotes/origin/tags/*
    2. Have it build all tag "branches" with the Branch Specifier */tags/*
    3. Enable SCM polling, so that the job detects new tags.

    This approach has one drawback: The job will build all tags and not just newly added tags. So after you have created the job, it will be triggered once for every existing tag. So you probably want to have the job do nothing at first, then wait until all existing tags have been processed, and only then configure the build steps you want to be done for every new tag.

    Since tags don't change in git, the job will then only be triggered once for every new tag.

    这篇关于Jenkins可以自动检测并在git仓库中创建新创建的标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆