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

Can we pass parameters/arguments to reusable step

emanuel November 23, 2020

We have steps that we are using for testing our python services.

The steps called 9 times and the only change inside the steps is the argument passed to our script

pipelines:
default:
- parallel:
- <<: *python-service-...1
- <<: *python-service-...2
- <<: *python-service-...3
- <<: *python-service-...4
...

 Can we pass an argument to one reusable step ??

Something like this:

pipelines:
default:
- parallel:
- <<: *python-test {...1}
- <<: *python-test {...2}
- <<: *python-test {...3}
- <<: *python-test {...4}
...
python-test: &python-test
step:
image: ...
name: Python Test - $SERVICE
script:
- source scripts/python_test.sh $SERVICE
artifacts:
- "**/$SERVICE-coverage.xml"

 

1 answer

0 votes
Jason Harrison November 26, 2020

You can definitely call a script from a step, and have it call the script with each of the arguments. But as for getting the pipeline to pass the argument and to perform the steps in parallel....not that I know of.

emanuel November 29, 2020

It won't help me to parallelize the flow, I will need to handle threads/processes inside the script.

In the case of pytest/pip, I don't want to handle threads.

tomer-x February 4, 2021

Also need the current functionality 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events