How to use an and operator in 'run_if'?

#1

i want to skip or run a step with ‘run_if’.

for example, i have a two env for condition.

envman add --key SKIP_SOMETHING1 --value "skip"
envman add --key SKIP_SOMETHING2 --value "skip"

is follow expression possible? i want to use ‘and(&&)’ operation with two envs.

run_if: enveq "SKIP_SOMETHING1" "skip" | enveq "SKIP_SOMETHING2" "skip" | not
0 Likes

#2

Hy there!

I would evaluate the 2 envs first then use it in the run if condition like

Script step:

#!bin/bash

$ENV3 = false

if [ $ENV == true ] && [ $ENV2 == true ]
then
$ENV3 = true
fi

then in the actual step I would use run_if like

run_if: |-
 	{{enveq "$ENV3" "true"}}
2 Likes

closed #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

0 Likes