Steve Campbell
Steve Campbell

Reputation: 3605

In Drone 0.5, is it possible to apply a matrix to only certain pipeline steps?

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

Upvotes: 0

Views: 409

Answers (1)

f3d
f3d

Reputation: 26

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

Upvotes: 1

Related Questions