期望是:在 master 分支中的 Dockerfile,requirements.txt ,.gitlab-ci.yml 3 个文件中只要有一个发生变化时,就触发 build 这个 stage
但根据以下配置,目前实际触发情况是,所有分支都跑这了个 stage,而且所有提交都触发,看上去这个 only 压根是没有生效,不知道是配置有误还是怎么的,官方文档也是这么配置的,大家帮忙看一下是哪里的问题
# ..gitlab-ci.yml
.main:
image: base:latest
stages:
- build
build_image:
stage: build
tags:
- tag
extends: .main
script:
- docker build -t test:stable .
only:
refs:
- master
changes:
- Dockerfile
- requirements.txt
- .gitlab-ci.yml
来自官方文档: https://docs.gitlab.com/ee/ci/yaml/#only--except
docker build:
script: docker build -t my-image:$CI_COMMIT_REF_SLUG .
only:
refs:
- branches
changes:
- Dockerfile
- docker/scripts/*
- dockerfiles/**/*
- more_scripts/*.{rb,py,sh}