You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

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.

Behaviour

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

Queue

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 and wait for all the queue conditions to evaluate to true. Continua will immediately begin executing the build once all the queue condition 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.

 

Discard

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 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.

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 values.

  • No labels