最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

continuous integration - Gitlab CICD how to trigger stage on branch or tag - Stack Overflow

programmeradmin2浏览0评论
build_job:
  stage: build
  only:
    - master   # ✅ Runs on master branch
    - tags     # ✅ Runs when a tag is pushed
  script:
    # long and boring
  artifacts:
    paths:
      - $BUILD_DIR/*
    expire_in: 1 year

package_job:
  stage: package
  needs:
    - build_job  
  only:
    - tags       
  script:

When I push master the build_job only is executed - correct When I push tag only buld_job is not executed but package_job is executed (and failed of course) as it is incorrect

How can I execute build_job on master and tags but not other branches?

build_job:
  stage: build
  only:
    - master   # ✅ Runs on master branch
    - tags     # ✅ Runs when a tag is pushed
  script:
    # long and boring
  artifacts:
    paths:
      - $BUILD_DIR/*
    expire_in: 1 year

package_job:
  stage: package
  needs:
    - build_job  
  only:
    - tags       
  script:

When I push master the build_job only is executed - correct When I push tag only buld_job is not executed but package_job is executed (and failed of course) as it is incorrect

How can I execute build_job on master and tags but not other branches?

Share Improve this question edited yesterday bryanbcook 18.1k2 gold badges46 silver badges78 bronze badges asked yesterday 0___________0___________ 67.5k4 gold badges37 silver badges81 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I was stupid and I was tagging the commit without it. Feel embarrassed

发布评论

评论列表(0)

  1. 暂无评论