Hello,
I would like to know if it is possible when running a pipeline, to choose which scripts will be executed. Ex:
Hi @Júlio César Fonseca Costa and welcome to the community!
It is not possible to execute only some commands of a step's script. When a step runs, all the commands in its script will be executed sequentially (unless one of them fails and the step fails, then the rest won't be executed).
If you don't want all of them to be executed, you can create a separate manual step for each API and then run manually the step(s) you want.
Another option would be to use a custom pipeline that can make use of variables, as follows:
pipelines:
custom:
my-custom-pipeline-name: #name of this pipeline
- variables: #list variable names under here
- name: api
default: "api1" # optionally provide a default variable value
allowed-values: # optionally restrict variable values
- "api1"
- "api2"
- "api3"
- step:
script:
- chmod +x sh/script.sh
- ./sh/script.sh $api
In this example, I am using a variable named api, with allowed values api1, api2, and api3. When you try to run manually a custom pipeline like this, you will be asked to choose the value for the variable api. If you want to run more than 1 apis, you will need to run the custom pipeline multiple times, one for each value.
If you have any questions, please feel free to let me know.
Kind regards,
Theodora
Hello @Theodora Boudale
Thanks for your answer, I'm going to use the option of having custom pipelines anyway.
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome @Júlio César Fonseca Costa, please feel free to reach out if you ever need anything else!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.