Git参数插件-过滤分支 [英] Git Parameter Plugin - filtering branches

查看:449
本文介绍了Git参数插件-过滤分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用GIT参数插件列出所有在构建过程中需要使用的发行分支。
如果我仅使用该插件指定参数类型,则可以正常使用
$ a $ b 简单的插件配置

I'm trying to use the GIT Parameter Plug-in to list all release branches that need to go in a build process. If I use the plug-in only specifying the parameter type it works fine simple plug-in configuration

当我尝试使用 分支过滤器 选项,列表显示为空。
我已经尝试过分支过滤器字段,其值如下:

When I try to filter the list using the Branch Filter option the list appears empty. I've tried the Branch Filter field with the following values:


  • 来源/发行版/ *

  • 版本*

  • 起源/发行版// *

但是它们似乎都是错误的。

But they all appear to be wrong.


  • 有人配置过这种过滤选项吗?

如果我只想列出我的发行分支,则可以开发(用于测试环境)和master(用于生产环境)。

If I wound like to list only my release branches ,my develop (for testing environments) and master (for production environments).


  • 是否可以进行多种过滤?

推荐答案

Git Parameter插件提供了一些选项,可用于RegEx指定分支或标签。遵循的步骤

The Git Parameter plugin provides option to make use for RegEx to specify the branch or tag . Steps to be followed


  1. 选中复选框,指出此项目已参数化

  1. Tick the checkbox stating 'This project is parameterized'

指定参数名称并选择参数类型(在您所在的分支)

Specify the name of the parameter and select the parameter type (In your case branch)

单击高级选项,并与分支过滤器相对应,在RegEx origin / release /.*中进行发布, origin / develop /.*表示开发, origin / master /.*表示master

Click on the Advanced option , and corresponding to Branch filter fill in the RegEx origin/release/.* for release , origin/develop/.* for develop and origin/master/.* for master

您可以根据您在分支过滤器选项
中提供的正则表达式配置多个分支过滤。例如:(origin / develop | origin / release /.*)将列出origin / develop分支以及所有发行分支

You can configure multiple branch filtering based on the Regex you provide in the Branch filter option Eg-: (origin/develop|origin/release/.*) will list the origin/develop branch along with all the release branches

这篇关于Git参数插件-过滤分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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