Trigger Gitlab-CI Pipeline only when there is a new tag

后端 未结 3 956
旧时难觅i
旧时难觅i 2021-01-05 15:32

I have following gitlab-ci conf. file:

before_script:
  - echo %CI_BUILD_REF%
  - echo %CI_PROJECT_DIR%

stages:
  - createPBLs
  - build
  - package


creat         


        
3条回答
  •  旧巷少年郎
    2021-01-05 16:00

    I recommend to use pattern in varibles-expression using commits

    Example

    build_api:
     stage: build
     script:
      - docker build --pull -t $CONTAINER_TEST_IMAGE .
      - docker push $CONTAINER_TEST_IMAGE
    only:
      variables:
       - $CI_COMMIT_MESSAGE =~ /(\[pipeline\]|(merge))/     
    

    Here i am saying that only execute that job when have [pipeline] or merge inside the commit. More info, here in gitlab

提交回复
热议问题