Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Configuration Conditions are used as a way to queue or discard a build if certain conditions are met. When creating a condition, you provide a behaviour, the build type it's applied to and a list of conditions. The following image shows the dialog when creating a configuration condition.

Image RemovedImage Added

Behaviour

This field defines the behaviour of the build when the conditions are met. You can choose between Queue and Discard.

...

A Queue condition controls when a build should begin executing. If a build is triggered and it contains a Queue condition, Continua will not begin executing the build until all of the queue condition expressions have been met. The build will simply sit in the build queue waiting and wait for all of its the queue conditions to evaluate to true. Continua will immediately begin executing the build once all the queue condition expression expressions evaluate to true. This is handy for situations where you want to control how a configuration is executed.

For example, you could configure a queue condition so that no builds run between 9-5. To set this up you would create a queue condition with the following expression: $Server.Now.Hour$ Not between 9,16 (As seen in the screenshot above). With this condition, any builds in this configuration that were triggered between 9am and 5pm would sit on the queue until 5pm. At this point it would then run all the builds that were waiting on this condition. If a build was triggered outside these hours then it would run as normal.

 

  • Queue: When any of the conditions are met, the build will be put on the queue rather than started immediately. This is handy for situations where you want to control when you want builds run. For example, you could configure it so no builds run during 9-5 work hours or perhaps during week days. You can also set it up so it queues a build until there's a new change set.
  • Discard: When any of the conditions are met, the build won't be run at all and will be marked as discarded. This is handy for situations where you don't want builds queuing up continuously. For example, you might create a condition that discards the build when there's no new change sets. You could setup a Queue behaviour for that particular condition but the problem with queue is, any time a build is started it will be queued and subsequently run eventually. With discard the build is stopped and will never run again.

Discard

Image Added

A discard condition will stop a build before it is executed if any of its expressions evaluate to true. Note that this is different to queue conditions as only one expression needs to be met for the build to be discarded. The difference between discarding and queueing a build is that a discarded build will never run again while a queued build can run at a later time. Discarding builds is useful when certain types of builds should never get built.

For example, you could configure a discard condition so that it discards all triggered builds that have no new change sets. This can be setup by creating a discard condition that is applied to Triggers with the following expression: $Build.HasNewChanges$ Equals true (As seen in the screenshot above). With this condition, any triggered builds that have no new changes will not be built. This would be useful if you have several time triggers and any new builds would be the same as the previous build. 

Applied to

  • User: This condition will only be checked when builds are a build is started manually by a user. A build can only be manually started through the Continua interface by pressing the run or quick run buttons on the Configuration pages.
  • Triggers: This condition will only be checked if the build was started by a trigger. Triggered builds include repository triggerstime triggers and build completed triggers.
  • Any: All builds will evaluate this condition.

Conditions

Expressions

Expressions are the individual criteria that will be evaluated to determine whether this condition passes or fails. Expressions take the form of <Left value> <operator> <Right Value>. For example the expression 1 equals 2 will always fail while the expression 1 does not equal 2 will always pass.

Multiple expressions can be linked to each condition by clicking the plus icon to the right of the expressions. If you are creating a queue condition then all expressions must evaluate to true, but if you are creating a discard condition then at least 1 expression must evaluate to true for the build to be discarded.

Note that query syntax can be used when setting the left and right valuesThe conditions listed here are the same as the other conditions in Continua. You can use the query syntax in the fields and supply multiple conditions. A Configuration condition is defined as being both the Behaviour and Applied to, plus the conditions listed here. You could also refer to these conditions as a Configuration condition's conditions. Regardless of the behavior of a Configuration condition, if any of the Configuration condition's conditions evaluate to true, then the specified behavior will result. Another way to interpret it would be: "If any of these conditions evaluate to true, my build will be Queued/Discarded".