如何在 Gitlab-ci 中为 =~ 使用斜线
How to use slash for =~ in Gitlab-ci
我使用 Tag($CI_COMMIT_TAG) 来控制事件。
我需要让标签与我的标签名称部分相似。
这是我的 yml
我的 Commit_Tag 通常喜欢 feature/dev/helloworld...
如何在正则表达式运算符中使用斜杠?
谢谢
build_dev_job:
stage: build
only:
variables:
- '$CI_COMMIT_TAG =~ /^feature/dev_*/'
script:
- export VERSION=$(date +%y.%m.%d)
- docker build -t my_dotnet_app:$VERSION -f ./Dockerfile .
tags:
- core-runner
GitLab 使用 re2 syntax.
要将任何字符转义为文字,请在其前面加上 \
/^feature\/dev_*/
请记住,您需要注意 YAML 语法,并且您的文本不会被解释为 YAML 中的转义序列。
我使用 Tag($CI_COMMIT_TAG) 来控制事件。
我需要让标签与我的标签名称部分相似。
这是我的 yml
我的 Commit_Tag 通常喜欢 feature/dev/helloworld...
如何在正则表达式运算符中使用斜杠?
谢谢
build_dev_job:
stage: build
only:
variables:
- '$CI_COMMIT_TAG =~ /^feature/dev_*/'
script:
- export VERSION=$(date +%y.%m.%d)
- docker build -t my_dotnet_app:$VERSION -f ./Dockerfile .
tags:
- core-runner
GitLab 使用 re2 syntax.
要将任何字符转义为文字,请在其前面加上 \
/^feature\/dev_*/
请记住,您需要注意 YAML 语法,并且您的文本不会被解释为 YAML 中的转义序列。