0
votes

I am trying to run a CI stage in Azure DevOps in a self-hosted Linux Agent. The stages look like below:

CI - Build Job:

  • Task 1: Python script to check a TRUE OR FALSE condition

  • Task 2: Bash script to execute certain commands

Now, Task 2 Should run only when the Task 1 py script execution contains only "TRUE".

I have referred a few docs which suggested to go with custom conditions from the following link:

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=classic

But not sure how to write custom condition as I am new to this.

NOTE: I want to try only in a custom mode, not in YAML

1
what is custom mode?Shayki Abramczyk
My apologies., its classic modeLakshmi2696

1 Answers

0
votes

We can define a new variable or update a variable in the python script when the Task 1 py script execution contains only "TRUE", then use the variable in the condition. Sample condition eq(variables['{variable name}'], '{variable value}'), the task 2 will only run if the condition is determined to be successful, if the result is fail, the task 2 will be skipped.