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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.