首页

    gitlab CI defines job to run after manual job completes successfully

    标签:gitlab-CI-CD

    标题啥意思呢?举个例子,我博客的gitlab ci配置分为3个stage

    stages:
      - build
      - release
      - deploy
    

    之前这3步都是手动触发,现在我想release(手动触发)成功后,不用手动触发,直接就deploy.
    如果去掉deploywhen:manual,build后还没手动触发release,deploy就开始执行了

    怎么办?

    • allow_failure,在release加上allow_failure: false,阻塞pipeline后面的job.
    • when,在deploy加上when: on_success,保证只有release执行成功后,deploy才会执行。when的默认值是on_success,所以不加上也没关系

    jobs retry

    需要注意的是点击retry,只会触发当前的job.比如,我retry了上面的release,即使release执行成功,也不会接着执行后面的deploy