1

Currently i am using "post-build Actions" in order to trigger another build and it works, i have a condition of "string match" that if it matches the build triggered,

Now i have another job i would like to trigger, just in the opposide condition, but this time i have to verify 2 strings doesn't match, is that possible?

This works - Illustarion: enter image description here

What i would like to do now is something like this (notice the "|" sepearting the two strings.

is that valid syntax as far as the plugin of triggering the jobs in the "Flexible Publish"?: enter image description here

Thanks in advance for your time and help :)

*** EDIT *** I found in the plugin there's an "AND" option which lets you then choose "X" number of strings Solution

2 Answers 2

1

The condition you’re using with Not > Strings Match > web|lxsOnly won’t work as intended because it’s treating web|lxsOnly as a literal string, not a regex or multiple values. Jenkins’ Flexible Publish doesn’t interpret | as OR.

You can use a small Groovy expression in Jenkins (assuming you’re using the Flexible Publish or Conditional BuildStep Plugin that supports Groovy scripting):

def buildType = build.buildVariableResolver.resolve("BuildType")
return !(buildType == "web" || buildType == "lxsOnly")

This expression ensures the conditional block runs only if ${BuildType} is something else

1
  • Hey, i Found the answer just a minute ago, there's an option in plugin to do an "AND" and than i can choose 2 strings and negate them, Thanks alot :)
    – alon hen
    Commented Apr 18 at 14:12
1

i Found the answer just a minute ago, there's an option in plugin to do an "AND" and than i can choose 2 strings and negate them, Thanks alot :)

Added a picture in the post's main content above

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.