Process Triggers

When a process is stored in your repository's /.svnplace/processes then it will be started by one of a number of events on that repository. Which events cause it to start is given in the triggers secion.

triggers:
    start_commit:
    pre_commit:
    post_commit:
    pre_revprop_change:
    post_revprop_change:
    pre_lock:
    post_lock:
    pre_unlock:
    post_unlock:
    time:

Each event can be given briefly:

triggers:
    post_commit:
        - ~/trunk/index.md

or, if more than the single property needs to be given:

triggers:
    poat_commit:
        changed:
            - ~/trunk/index.md
        args:
            notify: 'joebloggs'

Common values

All events provide:

event.name
the name of the event

start_commit:

Triggered by the start-commit hook.

triggers:
    start_commit:
        args:
            notify: 'joebloggs'

The parameter for the brief form is args:.

Values

These values are available:

event.name
start-commit
event.repo.*
the repo where the post-commit happened
event.capabilities
the capabilities from the hook call
event.txn_name
the name of the transaction
event.user.*
the start commit user, or None

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    start_commit:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

pre_commit:

Triggered by the pre-commit hook.

triggers:
    pre_commit:
        changed:
            - ~/trunk/index.md
        args:
            notify: 'joebloggs'

The parameter for the brief form is changed:.

Values

These values are available:

event.name
pre-commit
event.repo.*
the repo where the post-commit happened
event.txn_name
the name of the transaction
event.user.*
the pre commit user, or None

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    pre_commit:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

post_commit:

Triggered by the post-commit hook.

triggers:
    post_commit:
        changed:
            - ~/trunk/index.md
        args:
            notify: 'joebloggs'

The parameter for the brief form is changed:.

Values

These values are available:

event.name
post-commit
event.repo.*
the repo where the post-commit happened
event.revision
the new revision
event.txn_name
the name of the transaction
event.changes[].path
the path in the repository of the changed item
event.changes[].change
how the item changed
event.author
the username of the checkin's author
event.user.*
the checkin user, or None
event.datestamp
the checkin date
event.message
the checkin message

changed:

If changed: is missing, any post-commit will trigger the process.

Give a list of path wildcards:

triggers:
    post_commit:
        changed:
            - +~/.svnplace/process/**
            - -/tags/**

The process will trigger when any of the checkin's changes match one of these.

Start each entry with one of more of +, - or ~:

+ added

- deleted

~ modified

The path itself wildmatches the same as .gitignore.

Examples:

+~/.svnplace/process/**
trigger when anything in /.svnplace/process is added or modified
-/tags/**
trigger when anything in /tags is deleted

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    post_commit:
        args:
            whathappened: 'A '+event.

Note these are python expressions.

pre_revprop_change:

Triggered by the pre-revprop-change hook.

triggers:
    pre_revprop_change:
        properties:
            - sp:testproperty
        args:
            notify: 'joebloggs'

The parameter for the brief form is properties:.

Values

These values are available:

event.name
pre-revprop-change
event.repo.*
the repo where the property is being changed
event.revision
the version having its revision property changed
event.propname
the name of revision property
event.action
the change to the revision property from the hook
event.value
the value being assigned, ie stdin from the hook
event.user.*
the user changing the revisiion property

properties:

Which properties will cause this process to be triggered. If missing, then all revision properties will trigger this process.

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    pre_revprop_change:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

post_revprop_change:

Triggered by the pre-revprop-change hook.

triggers:
    post_revprop_change:
        properties:
            - sp:testproperty
        args:
            notify: 'joebloggs'

The parameter for the brief form is properties:.

Values

These values are available:

event.name
post-revprop-change
event.repo.*
the repo where the property is being changed
event.revision
the version having its revision property changed
event.propname
the name of revision property
event.action
the change to the revision property from the hook
event.value
the value being assigned, ie stdin from the hook
event.user.*
the user changing the revisiion property

properties:

Which properties will cause this process to be triggered. If missing, then all revision properties will trigger this process.

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    post_revprop_change:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

pre_lock:

Triggered by the pre-lock hook.

triggers:
    pre_lock:
        paths:
            - /.svnplace/process/**
            - /tags/**
        args:
            notify: 'joebloggs'

The parameter for the brief form is paths:.

Values

These values are available:

event.name
pre-lock
event.repo.*
the repo where the property is being changed
event.path
The path being locked
event.comment
The comment, when available, form the hook
event.steal
Whether the lock is being stolen
event.user.*
the user locking

paths:

If paths: is missing, any pre-lock will trigger the process.

Give a list of path wildcards:

triggers:
    pre_lock:
        paths:
            - /.svnplace/process/**
            - /tags/**

The process will trigger when any of the lock's paths match one of these.

Each path in paths: wildmatches the same as .gitignore.

Examples:

/.svnplace/process/**
trigger when anything in /.svnplace/process is locked
-/tags/**
trigger when anything in /tags is locks

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    pre_lock:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

post_lock:

Triggered by the post-lock hook.

triggers:
    post_lock:
        paths:
            - /.svnplace/process/**
            - /tags/**
        args:
            notify: 'joebloggs'

The parameter for the brief form is paths:.

Values

These values are available:

event.name
post-lock
event.repo.*
the repo where the property is being changed
event.paths
The paths being locked
event.user.*
the user locking

paths:

If paths: is missing, any post-lock will trigger the process.

Give a list of path wildcards:

triggers:
    post_commit:
        paths:
            - /.svnplace/process/**
            - /tags/**

The process will trigger when any of the lock's paths match one of these.

Each path in paths: wildmatches the same as .gitignore.

Examples:

/.svnplace/process/**
trigger when anything in /.svnplace/process is locked
-/tags/**
trigger when anything in /tags is locks

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    post_lock:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

pre_unlock:

Triggered by the pre-unlock hook.

triggers:
    pre_unlock:
        paths:
            - /.svnplace/process/**
            - /tags/**
        args:
            notify: 'joebloggs'

The parameter for the brief form is paths:.

Values

These values are available:

event.name
pre-unlock
event.repo.*
the repo where the property is being changed
event.path
The path being locked
event.token
The token from the hook
event.break_unlock
Whether the lock is being broken
event.user.*
the user unlocking

paths:

If paths: is missing, any pre-unlock will trigger the process.

Give a list of path wildcards:

triggers:
    post_commit:
        paths:
            - /.svnplace/process/**
            - /tags/**

The process will trigger when any of the lock's paths match one of these.

Each path in paths: wildmatches the same as .gitignore.

Examples:

/.svnplace/process/**
trigger when anything in /.svnplace/process is locked
-/tags/**
trigger when anything in /tags is locks

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    pre_unlock:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

post_unlock:

Triggered by the post-unlock hook.

triggers:
    post_unlock:
        paths:
            - /.svnplace/process/**
            - /tags/**
        args:
            notify: 'joebloggs'

The parameter for the brief form is paths:.

Values

These values are available:

event.name
post-unlock
event.repo.*
the repo where the property is being changed
event.paths
The paths being locked
event.user.*
the user locking

paths:

If paths: is missing, any post-lock will trigger the process.

Give a list of path wildcards:

triggers:
    post_commit:
        paths:
            - /.svnplace/process/**
            - /tags/**

The process will trigger when any of the lock's paths match one of these.

Each path in paths: wildmatches the same as .gitignore.

Examples:

/.svnplace/process/**
trigger when anything in /.svnplace/process is locked
-/tags/**
trigger when anything in /tags is locks

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    post_unlock:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.

time:

Triggered by reaching certain times.

triggers:
    time:
        cron:
            - '0 23 * * *'
            - '0,15,30,45 23 * * L2'
        args:
            notify: 'joebloggs'

The parameter for the brief form is cron:.

Values

These values are available:

event.name
post-unlock
event.repo.*
the repo where the property is being changed
event.cron
Which cron triggered the event
event.user.*
the repo's owner (who is assumed to have triggered the event)

cron:

Which times trigger the event. These are cron strings. If there are none, then the event will never trigger.

The format is a space separated list of `minute hour day month weekday'.

minute
a comma-separated list of minutes between 0 and 59, or L to mean the last minute (in the hour). Minutes are rounded down to multiples of 5 minutes. This means this event will trigger at most 12 times each hour.
hour
*, or a comma-separated list of hours between 0 and 23, or L. * means every hour, 1 means 1am, 13 means 1pm and so on. L means the last hour (11pm).
day
  • or a comma-seprated list of days between 1 and 31, or L. * means every day, 1,2,3 means the 1st, 2nd or 3rd day of the month, and L means the last day of the month. Note that day and weekday union together, so 5 0 1 * 0 means 5 past midnight on the 1st and any Monday.
month
*, or a comma-separated list of months between 1 and 12 or L (to mean the last month, December)
weekday
  • or a comma-separated list of weekdays between 0 and 6 (all 0-Mondays, 1-Tuesdays etc), or L0 to L6 (the last L0-Monday, L1-Tuesday etc in a month). Note that day and weekday union together, so 5 0 1 * 0 means 5 past midnight on the 1st and any Monday.

Examples:

triggers:
    time:
        cron:
            - 15 1 * * *

A quarter past 1am every morinig.

triggers:
    time:
        cron:
            - 0 17 29 2 *

Five pm on the 29th Febuary.

triggers:
    time:
        cron:
            - 0 12 * * 4

12pm every Friday

triggers:
    time:
        cron:
            - 0 12 * * L1

12pm on the last Tuesday of every month.

triggers:
    time:
        cron:
            - 0,30 * * * *

Every half an hour.

triggers:
    time:
        cron:
            - 15 8,17 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 * *

08:15 and 17:15 on days with an even date.

args:

A set of assignments. These will be available to the process, the same as a process's args.

triggers:
    post_unlock:
        args:
            whathappened: 'A '+event.name

Note these are python expressions.