0

I have a matrix in my drone.yml, but it only should run on one of my pipeline steps. Is it possible to only apply the matrix to certain steps?

For example, I do not want the matrix to apply on the publish step:

pipeline:
  test:
    image: ruby
    commands:
      - bundle exec rspec ${TESTFOLDER}
  publish:
    image: ruby
    commands:
      - magic-publish

matrix:
  TESTFOLDER:
    - integration/user
    - integration/shopping_cart
    - integration/payments
    - units
Steve Campbell
  • 3,385
  • 1
  • 31
  • 43

1 Answers1

1

If you wish to "magic-publish" only once, you might want to restrict it to a single element of your matrix (maybe the last one):

when:
  matrix:
    TESTFOLDER: units

You could also attach the deployment step to a tag or deploy event.

cf. How to setup conditional build steps

Mahendra Gunawardena
  • 1,956
  • 5
  • 26
  • 45
f3d
  • 26
  • 1