首页
关于
打字游戏
更多
关于
打字游戏
Search
1
Typecho安装支持生成目录、流程图(Mermaid)、数学公式(MathJax)Markdown解析器插件Parsedown
845 阅读
2
Ubuntu22.04修改网络IP地址
434 阅读
3
使用frp进行内网穿透,实现远程ssh连接内网主机
312 阅读
4
Ubuntu22.04中安装Kubernetes1.27高可用(Docker作为容器运行时)
250 阅读
5
Gitlab和Redmine集成问题追踪系统,Intellij IDEA中集成问题追踪系统
192 阅读
云原生
docker
kubernetes
typecho
web前端
DevOps
Git
英语
english-in-use-primary
大数据
Flink
StarRocks
Kafka
ClickHouse
Hadoop
HBase
ChatGPT
编程语言
时事热点
Tools
Intellij IDEA
frp
json
Linux
Ubuntu
登录
Search
标签搜索
Kubernetes
docker
Ubuntu22.04
k8s
docker-compose
docker安装
docker-compose安装
linux
Typecho
Markdown解析插件
TOC
Intellij IDEA
IDEA
Gitlab
Redmine
Gitlab集成Redmine
IDEA匹配ISSUE链接
frp
ssh
内网穿透
累计撰写
10
篇文章
累计收到
0
条评论
首页
栏目
云原生
docker
kubernetes
typecho
web前端
DevOps
Git
英语
english-in-use-primary
大数据
Flink
StarRocks
Kafka
ClickHouse
Hadoop
HBase
ChatGPT
编程语言
时事热点
Tools
Intellij IDEA
frp
json
Linux
Ubuntu
页面
关于
打字游戏
搜索到
3
篇与
的结果
2024-01-26
JSONPATH语法
JSONPath Syntax JSONPath notation Filters Examples Considerations for JSONPath expressions that return multiple elements FAQ See Also JSONPath Syntax 文档原文地址: https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html#filters Last modified on November 22, 2021 JSONPath is a query language for JSON, similar to XPath for XML. AlertSite API endpoint monitors let you use JSONPath in assertions to specify the JSON fields that need to be verified. JSONPath notation A JSONPath expression specifies a path to an element (or a set of elements) in a JSON structure. Paths can use the dot notation: $.store.book[0].title or the bracket notation: $['store']['book'][0]['title'] or a mix of dot and bracket notations: $['store'].book[0].title Note that dots are only used before property names not in brackets. The leading $ represents the root object or array and can be omitted. For example, $.foo.bar and foo.bar are the same, and so are $[0].status and [0].status. Other syntax elements are described below. Expression Description $ The root object or array. .*property* Selects the specified property in a parent object. ['*property*'] Selects the specified property in a parent object. Be sure to put single quotes around the property name.Tip: Use this notation if the property name contains special characters such as spaces, or begins with a character other than A..Za..z_. [*n*] Selects the n-th element from an array. Indexes are 0-based. [*index1*,*index2*,*…*] Selects array elements with the specified indexes. Returns a list. ..*property* Recursive descent: Searches for the specified property name recursively and returns an array of all values with this property name. Always returns a list, even if just one property is found. * Wildcard selects all elements in an object or an array, regardless of their names or indexes. For example, address.* means all properties of the address object, and book[*] means all items of the book array. [*start*:*end*] [*start*:] Selects array elements from the start index and up to, but not including, end index. If end is omitted, selects all elements from start until the end of the array. Returns a list. [:*n*] Selects the first n elements of the array. Returns a list. [*-n*:] Selects the last n elements of the array. Returns a list. [?(*expression*)] Filter expression. Selects all elements in an object or array that match the specified filter. Returns a list. [(*expression*)] Script expressions can be used instead of explicit property names or indexes. An example is [(@.length-1)] which selects the last item in an array. Here, length refers to the length of the current array rather than a JSON field named length. @ Used in filter expressions to refer to the current node being processed. Notes: JSONPath expressions, including property names and values, are case-sensitive. Unlike XPath, JSONPath does not have operations for accessing parent or sibling nodes from the given node. Filters Filters are logical expressions used to filter arrays. An example of a JSONPath expression with a filter is $.store.book[?(@.price < 10)] where @ represents the current array item or object being processed. Filters can also use $ to refer to the properties outside of the current object: $.store.book[?(@.price < $.expensive)] An expression that specifies just a property name, such as [?(@.isbn)], matches all items that have this property, regardless of the value. Below are the operators that can be used in filters. Supported operators depend on the monitor playback engine. Operator Description == Equals to. String values must be enclosed in single quotes (not double quotes): [?(@.color=='red')].Note: Number to string comparison works differently depending on the playback engine. In TestEngine, 1 does not equal '1'. In ReadyAPI 1.9 and earlier, 1 equals '1'. != Not equal to. String values must be enclosed in single quotes: [?(@.color!='red')]. > Greater than. >= Greater than or equal to. < Less than. <= Less than or equal to. =~ Matches a JavaScript regular expression. For example, [?(@.description =~ /cat.*/i)] matches items whose description starts with cat (case-insensitive).Note: Not supported if ReadyAPI 1.1 is used as the playback engine. ! Used to negate a filter: [?(!@.isbn)] matches items that do not have the isbn property.Note: Not supported if ReadyAPI 1.1 is used as the playback engine. && Logical AND, used to combine multiple filter expressions:[?(@.category=='fiction' && @.price < 10)] || Logical OR, used to combine multiple filter expressions:[?(@.category=='fiction' || @.price < 10)]Note: Not supported if ReadyAPI 1.1 is used as the playback engine. in Checks if the left-side value is present in the right-side list. Similar to the SQL IN operator. String comparison is case-sensitive.[?(@.size in ['M', 'L'])] [?('S' in @.sizes)]Note: Supported only by the TestEngine playback engine. nin Opposite of in. Checks that the left-side value is not present in the right-side list. String comparison is case-sensitive.[?(@.size nin ['M', 'L'])] [?('S' nin @.sizes)]Note: Supported only by the TestEngine playback engine. subsetof Checks if the left-side array is a subset of the right-side array. The actual order of array items does not matter. String comparison is case-sensitive. An empty left-side array always matches.For example:[?(@.sizes subsetof ['M', 'L'])] – matches if sizes is ['M'] or ['L'] or ['L', 'M'] but does not match if the array has any other elements.[?(['M', 'L'] subsetof @.sizes)] – matches if sizes contains at least 'M' and 'L'.Note: Supported only by the TestEngine playback engine. contains Checks if a string contains the specified substring (case-sensitive), or an array contains the specified element.[?(@.name contains 'Alex')] [?(@.numbers contains 7)] [?('ABCDEF' contains @.character)]Note: Supported only by the TestEngine playback engine. size Checks if an array or string has the specified length.[?(@.name size 4)]Note: Supported only by the TestEngine playback engine. empty true Matches an empty array or string.[?(@.name empty true)]Note: Supported only by the TestEngine playback engine. empty false Matches a non-empty array or string.[?(@.name empty false)]Note: Supported only by the TestEngine playback engine. Examples For these examples, we will use a modified version of JSON from http://goessner.net/articles/JsonPath/index.html#e3: { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "J.R.R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } }, "expensive": 10 } In all these examples, the leading $. is optional and can be omitted. Expression Meaning $.store.* All direct properties of store (not recursive). $.store.bicycle.color The color of the bicycle in the store.Result: red $.store..price $..price The prices of all items in the store.Result: [8.95, 8.99, 22.99, 19.95] $.store.book[*] $..book[*] All books in the store. $..book[*].title The titles of all books in the store.Result: [Sayings of the Century,Moby Dick,The Lord of the Rings] $..book[0] The first book.Result:[ { "category":"reference", "author":"Nigel Rees", "title":"Sayings of the Century", "price":8.95 } ] $..book[0].title The title of the first book.Result: Sayings of the Century $..book[0,1].title $..book[:2].title The titles of the first two books.Result: [Sayings of the Century, Moby Dick] $..book[-1:].title $..book[(@.length-1)].title The title of the last book.Result: [The Lord of the Rings]The result is a list, because [*-n*:] always returns lists. $..book[?(@.author=='J.R.R. Tolkien')].title The titles of all books by J.R.R. Tolkien (exact match, case-sensitive).Result: [The Lord of the Rings]The result is a list, because filters always return lists. $..book[?(@.isbn)] All books that have the isbn property. $..book[?(!@.isbn)] All books without the isbn property. $..book[?(@.price < 10)] All books cheaper than 10. $..book[?(@.price > $.expensive)] All expensive books. $..book[?(@.author =~ /.*Tolkien/i)] All books whose author name ends with Tolkien (case-insensitive). $..book[?(@.category == 'fiction' ||@.category == 'reference')] All fiction and reference books. $..* All members of the JSON structure beneath the root (child objects, individual property values, array items), combined into an array. Considerations for JSONPath expressions that return multiple elements JSONPath queries can return not just a single element, but also a list of matching elements. For example, given this JSON: { "name": "Rose Kolodny", "phoneNumbers": [ { "type": "home", "number": "954-555-1234" }, { "type": "work", "number": "754-555-5678" } ] } the JSONPath expression phoneNumbers[*].number returns a list containing two phone numbers: [954-555-1234, 754-555-5678] Note that this is not a JSON array, it is just a comma-separated list of items where [ ] indicates the beginning and end of the list. When using “equals” assertions against a list of matches, specify a list of expected values enclosed in [ ] and separated by a comma and one space: [apples, 15, false, ["foo","bar"], {"status":"ok"}] Standalone strings (like apples) should not have enclosing quotes, unless the quotes are part of the value. [Example](javascript:ShowExample("IDM5MMQY3TEHZ3II3HWNFO25ANWOEHQ3ZZ4JJWGOGW5P4BFEH421SP_id", "IDM5MMQY3TEHZ3II3HWNFO25ANWOEHQ3ZZ4JJWGOGW5P4BFEH421SP_div")) Values that are JSON arrays and objects keep inner quotes, but are minified with no spaces between their items: ["foo","bar"], not [ "foo" , "bar" ]. FAQ How can I check that my JSONPath syntax is valid? If you have ReadyAPI 1.9, you can create a test for your API endpoint, add a JSONPath Match assertion and test the syntax in the assertion editor there. Otherwise, you can use http://jsonpath.herokuapp.com and check the results on the Jayway tab. However, the syntax used on this site may be slightly different from the one used in AlertSite. See Also API Assertions Creating an API Endpoint Monitor API Endpoint Monitor Settings
2024年01月26日
97 阅读
0 评论
0 点赞
2023-11-26
使用frp进行内网穿透,实现远程ssh连接内网主机
需求 我想在公司的网络环境中连接到家里主机进行远程操作。 目前的解决方案: 远程控制软件: TeamViewer 向日葵 QQ 等等... 内网穿透工具 frp (前提:需要一台具有公网IP的主机) ... 但是,由于我的需求只是需要远程SSH到家里的主机,进行控制台操作,基本不涉及到图形化界面,因此,这里我选择frp内网穿透(前提: 我目前已经有一台能够具有公网ip的阿里云服务器), 顺便说一下, 现在阿里云云主机(99元一年,新老客户都可以): https://www.aliyun.com/minisite/goods?userCode=ej7w2qnx。 frp简介 通过在具有公网 IP 的节点上部署 frp 服务端,您可以轻松地将内网服务穿透到公网,并享受以下专业特性: 多种协议支持:客户端服务端通信支持 TCP、QUIC、KCP 和 Websocket 等多种协议。 TCP 连接流式复用:在单个连接上承载多个请求,减少连接建立时间,降低请求延迟。 代理组间的负载均衡。 端口复用:多个服务可以通过同一个服务端端口暴露。 P2P 通信:流量不必经过服务器中转,充分利用带宽资源。 客户端插件:提供多个原生支持的客户端插件,如静态文件查看、- -HTTPS/HTTP 协议转换、HTTP、SOCKS5 代理等,以便满足各种需求。 服务端插件系统:高度可扩展的服务端插件系统,便于根据自身需求进行功能扩展。 用户友好的 UI 页面:提供服务端和客户端的用户界面,使配置和监控变得更加方便。 下面是frp一些相关链接: GitHub项目地址(Go语言实现): https://github.com/fatedier/frp 文档地址: https://gofrp.org/zh-cn/docs/overview/ 实例配置: https://gofrp.org/zh-cn/docs/examples/ssh/ frp安装 frp是使用Go语言编写,支持跨平台的。 因此,只需要在具有公网IP的服务端下载软件和家里主机上下载进行简单配置即可。 目前(2023年11月26日13:01:37), 最新版本为: v0.52.3, 因此我们使用这个版本。 注意: 服务器和家里主机的版本最好一致。 下载地址: https://github.com/fatedier/frp/releases/tag/v0.52.3 如果下载比较缓慢,请开启VPN进行下载。 公网服务器安装fpr 解压安装包[root@iZ2zeb2i87ctar29rg4v28Z frp]# pwd /root/frp [root@iZ2zeb2i87ctar29rg4v28Z frp]# ll 总用量 11508 -rw-r--r-- 1 root root 11781267 11月 26 13:20 frp_0.52.3_linux_amd64.tar.gz [root@iZ2zeb2i87ctar29rg4v28Z frp]# tar -zxvf frp_0.52.3_linux_amd64.tar.gz frp_0.52.3_linux_amd64/ frp_0.52.3_linux_amd64/LICENSE frp_0.52.3_linux_amd64/frps.toml frp_0.52.3_linux_amd64/frpc frp_0.52.3_linux_amd64/frpc.toml frp_0.52.3_linux_amd64/frps [root@iZ2zeb2i87ctar29rg4v28Z frp]# ll 总用量 11512 drwxr-xr-x 2 1001 docker 4096 10月 24 10:57 frp_0.52.3_linux_amd64 -rw-r--r-- 1 root root 11781267 11月 26 13:20 frp_0.52.3_linux_amd64.tar.gz [root@iZ2zeb2i87ctar29rg4v28Z frp]# 配置 这里不需要配置, 只是看一下frps.toml文件中默认绑定的端口为: 7000即可。 [root@iZ2zeb2i87ctar29rg4v28Z frp]# ls frp_0.52.3_linux_amd64 frp_0.52.3_linux_amd64.tar.gz [root@iZ2zeb2i87ctar29rg4v28Z frp]# cd frp_0.52.3_linux_amd64/ [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# ls frpc frpc.toml frps frps.toml LICENSE [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# cat frps.toml bindPort = 7000 [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# 使用Systemd管理frp 注意:将/root/frp/frp_0.52.3_linux_amd64 替换成你的目录。 sudo cat > /etc/systemd/system/frps.service << EOF [Unit] # 服务名称 Description = frp server After = network.target syslog.target Wants = network.target [Service] Type = simple # 启动frps的命令 ExecStart = /root/frp/frp_0.52.3_linux_amd64/frps -c /root/frp/frp_0.52.3_linux_amd64/frps.toml [Install] WantedBy = multi-user.target EOF 执行过程: [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# sudo cat > /etc/systemd/system/frps.service << EOF > [Unit] > # 服务名称 > Description = frp server > After = network.target syslog.target > Wants = network.target > > [Service] > Type = simple > # 启动frps的命令 > ExecStart = /root/frp/frp_0.52.3_linux_amd64/frps -c /root/frp/frp_0.52.3_linux_amd64/frps.toml > > [Install] > WantedBy = multi-user.target > EOF [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# cat /etc/systemd/system/frps.service [Unit] # 服务名称 Description = frp server After = network.target syslog.target Wants = network.target [Service] Type = simple # 启动frps的命令 ExecStart = /root/frp/frp_0.52.3_linux_amd64/frps -c /root/frp/frp_0.52.3_linux_amd64/frps.toml [Install] WantedBy = multi-user.target [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# 启动frp [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# sudo systemctl start frps [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# sudo systemctl status frps ● frps.service - frp server Loaded: loaded (/etc/systemd/system/frps.service; disabled; vendor preset: enabled) Active: active (running) since Sun 2023-11-26 13:32:30 CST; 10s ago Main PID: 93946 (frps) Tasks: 5 (limit: 11849) Memory: 8.7M CGroup: /system.slice/frps.service └─93946 /root/frp/frp_0.52.3_linux_amd64/frps -c /root/frp/frp_0.52.3_linux_amd64/frps.toml 11月 26 13:32:30 iZ2zeb2i87ctar29rg4v28Z systemd[1]: Started frp server. 11月 26 13:32:30 iZ2zeb2i87ctar29rg4v28Z frps[93946]: 2023/11/26 13:32:30 [I] [root.go:102] frps uses config file: /root/frp/frp_0.52.3_linux_amd64/frps.toml 11月 26 13:32:30 iZ2zeb2i87ctar29rg4v28Z frps[93946]: 2023/11/26 13:32:30 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000 11月 26 13:32:30 iZ2zeb2i87ctar29rg4v28Z frps[93946]: 2023/11/26 13:32:30 [I] [root.go:111] frps started successfully [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# 开启开机启动 [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# sudo systemctl enable frps Created symlink /etc/systemd/system/multi-user.target.wants/frps.service → /etc/systemd/system/frps.service. [root@iZ2zeb2i87ctar29rg4v28Z frp_0.52.3_linux_amd64]# 配置云主机放开: 7000和6000端口 (略) 家里主机安装fpr 解压安装包 localhost:Documents zxy$ ls frp_0.52.3_darwin_amd64.tar.gz localhost:Documents zxy$ tar -xf frp_0.52.3_darwin_amd64.tar.gz localhost:Documents zxy$ ls frp_0.52.3_darwin_amd64.tar.gz frp_0.52.3_darwin_amd64 localhost:Documents zxy$ cd frp_0.52.3_darwin_amd64 localhost:frp_0.52.3_darwin_amd64 zxy$ ls LICENSE frpc frpc.toml frps frps.toml localhost:frp_0.52.3_darwin_amd64 zxy$ 配置 编辑 frpc.toml 文件,假设 frps 所在服务器的公网 IP 地址为 x.x.x.x。以下是示例配置: sudo cat > /Users/zxy/Documents/frp_0.52.3_darwin_amd64/frpc.toml << EOF serverAddr = "x.x.x.x" serverPort = 7000 [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 6000 EOF serverAddr frp服务端公网IP。 serverPort frp服务端端口。 localIP 和 localPort 配置为需要从公网访问的内网服务的地址和端口。 remotePort 表示在 frp 服务端监听的端口,访问此端口的流量将被转发到本地服务的相应端口。 启动 命令: ./frpc -c frpc.toml 过程: localhost:frp_0.52.3_darwin_amd64 zxy$ ./frpc -c frpc.toml 2023/11/26 13:48:29 [I] [root.go:139] start frpc service for config file [frpc.toml] 2023/11/26 13:48:29 [I] [service.go:299] [3d90255be67b269a] login to server success, get run id [3d90255be67b269a] 2023/11/26 13:48:29 [I] [proxy_manager.go:156] [3d90255be67b269a] proxy added: [ssh] 2023/11/26 13:48:29 [I] [control.go:173] [3d90255be67b269a] [ssh] start proxy success 家里电脑(MacOS)开启SSH访问 系统偏好设置 -> 共享 -> 勾选 远程登录 验证是否可以远程SSH连接 使用以下命令通过 SSH 访问内网机器,假设用户名为 test: ssh -o Port=6000 test@x.x.x.x frp 将请求发送到 x.x.x.x:6000 的流量转发到内网机器的 22 端口。 总结 到此,就可以完成远程ssh访问了。
2023年11月26日
312 阅读
0 评论
0 点赞
2023-11-22
Gitlab和Redmine集成问题追踪系统,Intellij IDEA中集成问题追踪系统
问题引入 技术工具 开发流程(大致) 痛点 解决 参考Apache Flink项目 Gitlab和Redmine集成 Intellij IDEA本地配置 总结 问题引入 技术工具 目前, 使用以下工具进行项目开发工作。 开发工具: Intellij IDEA 代码版本控制: Git 代码托管平台(内部搭建): Gitlab Issue追踪系统: Redmine 开发流程(大致) 产品提出相关需求,并在Redmine上创建需求对应的Issue 技术人员给出实现需求的设计,并在Redmine上产品创建Issue下创建对应的子Issue。 技术人员进行开发,拉取分支(分支名包含Redmine中的Issue编号),开发完成。 提交测试 测试完成,产品验收。 上线 痛点 我想要的最终目的: 快速定位:开发人员可以根据Git的提交信息快速定位代码改动所属的需求。因此,我们在提交代码填写提交信息的时候,都会带上本地提交的所属的Redmine上创建的Issue编号。 该目的表现在以下两个方面: 本地:git提交的消息(包含Redmine的Issue编号)怎么和Redmine系统中的Issue进行关联。 Gitlab: git提交的消息(包含Redmine的Issue编号)怎么和Redmine系统中的Issue进行关联。 解决 参考Apache Flink项目 我发现Apache Flink项目是通过JIRA作为问题追踪系统,GitHub作为代码库托管平台,Git作为代码版本管理工具。这和我使用的工具很像。 于是,通过查询Gitlab文档发现它也是可以和Redmine进行集成的,让Redmine作为问题追踪系统。 这就解决了痛点中的2. 另外,我发现Apache Flink 项目在Intellij IDEA中的提交信息中包含JIRA上创建的ISSUE也是通过点击进入到ISSUE对应的页面的。查看Intellij IDEA文档得到结局方案。 Gitlab和Redmine集成 官网文档参考: https://docs.gitlab.com/ee/user/project/integrations/redmine.html#reference-redmine-issues-in-gitlab 使用Redmine作为Gitlab的外部问题追踪系统。需要进行以下配置: 进入你Gitlab项目界面 点击Setting -> 找到Integrations 滑动鼠标,点击选择: Redmine 勾选 Action复选框 填写以下几个必填项 Project URL: 填写你Redmine中为该Gitlab创建的项目地址 Issue地址: 这个地址就是你Issue页面的URL,只是把最后的数字替换成:id 新建Issue地址: 这个URL目前没有使用,在以后得版本中可能会被删除 假设: Redmine的域名为:https://redmine.example.com 配置Redmine的项目名为: gitlab 则,这里给出一个配置的具体示例 Project URL: https://redmine.example.com/projects/gitla Issue URL: https://redmine.example.com/issues/:id New Issue URL: https://redmine.example.com/projects/gitlab/issues/new 填写好以后, 点击: Test setting. 出现successful字样就是成功了。 点击: Save changes 保存 你配置好以后,就可以看到在你项目的左侧栏中会出现Redmine选项,点击可以进入你配置的Redmine项目链接。 配置完成以后,如何在Git commit提交的消息中引用呢? 短引用(不推荐,会和Gitlab自身的Issue系统冲突,如果两个Issue编号相同,发生冲突后,以Gitlab内存为准):#<ID>,比如:Redmine中的Issue编号为100, 则你可以在git提交信息中使用: #100 引用该Issue编号。 长引用(推荐): <PROJECT>-<ID> , 比如: 你配置的项目为gitlab, Redmine中的Issue编号为100, 则你可以在git提交信息中使用: GITLAB-100(注意:这里项目名需要全大写) 引用该Issue编号。 代码提交到Gitlab以后,就可以根据<PROJECT>-<ID>自动生成链接到Redmine的链接了。 Intellij IDEA本地配置 本地配置参考Intellij IDEA文档: https://www.jetbrains.com/help/idea/handling-issues.html 以下是配置步骤: Intellij IDEA -> Setting... (Mac系统: command + ,) Version Controll -> Issue Navigation -> 点击 + -> Add Issue Navigation Link ![c4bde2ac4d152be1f770ef3eeb8b04fa.png](/usr/uploads/images/idea-setting.png 配置 Issue ID(regular express) : 正则匹配Git commit提交信息里面的内容 Issue Link: 将匹配到的Issue ID内容, 添加这里配置的超链接。 Explame 这里是让你实时验证你上面填写的内容 - Issue ID :输入待验证的内容 - Issue link : 显示通过以上填写的正则匹配到以后添加的链接地址 假设: 我们需要匹配提交信息中包含POLARIS-111这种格式的内容,匹配到以后给这个匹配内容添加一个超链接,连接到https://example.com/issue/111, 我们可以进行一下配置: 配置说明: POLARIS-(\d+): 这个正则匹配内容 https://example.com/issue/$1 : 这里是给上面匹配内容刚添加的超链接, 其中$1使用正则中反向引用,这里代码匹配到的数字,也就是111 点击 OK -> 点击 OK 查看Git提交历史记录 (Mac: command + 9) 可以看到已经添加上超链接了。 点击是可以跳转的。 总结 通过以上配置,我们将Gitlab和Redmine进行的集成,可以轻松的通过提交的消息包含Issue链接到Redmine系统。同时本地Intellij IDEA也可以此操作,可以很方便定位问题。
2023年11月22日
192 阅读
0 评论
0 点赞