ContinuityApp

Create a Suite Rule

Suites Rules let you add conditions to Suites. Whenever you create a Build Request, we go though all you suites, and we will start building them. With Rules, you can create suites that we skip until one of your rules is matched: so, you can create a Suite Rule to trigger the build only when a "#TESTME" string is in the commit message, or the owner is someone, or a specific file has been touched during the commit.

Auth&ACL

Both users and collaborators can access this API, via OAuth suites scope (or HTTP Basic Authentication for development purposes).

Definition

POST https://v1.continuityapp.ws/projects/<project_id>/suites/<suite_id>/rules

Arguments

Arguments    
subject Required The filed to test against, can be one of the following values:
subject commit.message The commit message.
subject commit.branches The commit branches (a commit can appear in more branches).
subject commit.ref The commit ref id.
subject commit.author_name The author name.
subject commit.author_email The author email.
subject commit.committer_name The committer name.
subject commit.committer_email The committer email.
operator Required Specifies which operator to use to test the subject.
operator contains Subject contains
operator does not contain Subject does not contain
operator equal to Subject is equal to
operator different than Subject is different than
operator match Provide your own regular expression.
value Required Specify the value to test the Subject against, using the Operator matching algoritm. (eg: "#TESTME", "marco@continuityapp.com", or a regular expression like "needs test$")

Example request

In this example we will create a rule which tests if the commit message contains the string "#TESTME". If the tests passes, the Suite will be executed.

$ curl https://v1.continuityapp.ws/projects/123456789123456780/suites/123456789123456789/rules?oauth_token=<access_token> \
    -d "subject=commit.message" \
    -d "operator=contains" \
    -d "value=%23TESTME" \
    -X POST

Returns

A Suite Rile will be returned.

Example response

{
  "response": {
    "id": 136138177273034912,
    "id_str": "136138177273034912",
    "subject": "commit.message",
    "operator": "contains",
    "value": "#TESTME"
  }
}

Errors

There are no specific errors for this API.

comments powered by Disqus