gitlab cicd中获取tag值的方式
目的:在job的script中获取标签的值,方便后面作业
.gitlab-ci.yml文件如下
# 定义 stages stages: - test test_nginx: stage: test tags: - test # only: # refs: # - /^aws/ rules: - if: $CI_COMMIT_TAG =~ /^aws/ script: - echo $CI_COMMIT_TAG - git diff --name-only HEAD HEAD~1 | grep -q "1.txt" && echo "文件已更改" || echo "文件未更改"
努力生活,融于自然