0

I have the following gitlab pipeline as below:

stages:
  - code-analyze
  - build
  - setup
  - test
  - teardown

check-style:
  extends: .base
  stage: code-analyze
  script: ./gradlew styleCheck

build-code:
  extends: .base
  stage: build
  script: ./gradlew build

buid-infra:
  extends: .base
  stage: setup
  script: echo "run setup infra"

run-integration-test:
  extends: .base
  stage: test
  script: echo "run integration test"
  needs: [buid-infra]

run-performance-test:
  extends: .base
  stage: test
  script: echo "run performance test"
  needs: [buid-infra]

teardown:
  extends: .base
  stage: teardown
  script: echo "run teardown"
  needs: [buid-infra]

I want to run teardown step even in cases where build-infra OR run-integration-test OR run-performance-test fails. I dunt want to use allow_failure since it does not mark the pipeline as failed. Is there a way to achieve such a workflow in gitlab CI ?

CyberPunk
  • 1,297
  • 5
  • 18
  • 35
  • Does this answer your question? [Gitlab-CI: Specify that Job C should run after Job B if Job A fails](https://stackoverflow.com/questions/64205410/gitlab-ci-specify-that-job-c-should-run-after-job-b-if-job-a-fails) – Babasile Jun 02 '23 at 21:34

0 Answers0