Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to define the test step only once in pipelines?

Roland van Laar December 24, 2019

We have a default pipeline which has all the steps for automatic testing.

For the test and master branch we also have a deploy step.

How can we define the automatic testing step only once?

 

pipelines: 
default:
-
step:
caches:
-
pip
-
poetry
script: # Modify the commands below to build your repository.
-
pip install poetry
-
poetry install
-
poetry run ./manage.py test --keepdb
services:
-
postgres
branches:
'test':
- step: ... etc

1 answer

1 accepted

0 votes
Answer accepted
Roland van Laar December 24, 2019

And found it on wikipedia: https://en.wikipedia.org/wiki/YAML#Advanced_components

 

Give a step a name:

-step: &id_NAME_SOMETHING
script:
- do something
- do something too

And later on do:

-step: *id_NAME_SOMETHING

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events