Process files use YAML. You can find out about YAML here.
Processes would usually be stored in a repository's /.svnplace/processes
directory. They can be stored elsewhere, but
their triggers won't operate - these processes can only be run by starting them using the API or the user interface.
name:
run_title:
triggers:
start_commit:
pre_commit:
post_commit:
pre_revprop_change:
post_revprop_change:
pre_lock:
post_lock:
pre_unlock:
post_unlock:
time:
args:
argtests:
role:
jobs:
jobname:
steps:
results:
name:
run_title:
triggers:
args:
argtests:
role:
jobs:
results:
name:
optional The name of the process. This is used for choosing a process to run in the user interface, and as the default title for each run of the process.
run_title:
optional The title for each run of the process. This string can have {expression}
substitutions. The values which can be used
are explained in the values section.
triggers:
optional Which events which trigger this process to be run. To triggers work, your process must be stored in /.svnplace/processes
.
triggers:
start_commit:
pre_commit:
post_commit:
pre_revprop_change:
post_revprop_change:
pre_lock:
post_lock:
pre_unlock:
post_unlock:
time:
These can be given no parameters:
triggers:
post_commit:
when all of those events will trigger the process. Some triggers, eg time:
, have to be given a parameter.
There is a brief style, where one of the event's parameters is given:
triggers:
post_commit:
- ~/trunk/index.md
Or they can be given fully:
triggers:
poat_commit:
changed:
- ~/trunk/index.md
args:
notify: 'joebloggs'
The details of each type of event are given in the triggers document.
args:
optional Values which are required by the process.
args:
an_argument:
name:
label:
input_type:
python_type:
placeholder:
tests:
meta:
another_argument:
...
name:
label:
input_type:
checkbox
, color
,
date
, email
, month
, number
, password
, text
default.python_type:
str
default, int
, float
,
bool
, yaml
.placeholder:
tests:
True
to accept the argument. The value value
is
the argument being tested. Also available are the run values, process
, user
and repo
.meta:
meta:
kindsargs:
an_argument:
meta:
kind: select
options:
-
value: The value
label: The label for the value
-
value: ...
argtests:
optional A list of tests which must all be True.
argtests:
-
check: len(an_argument)>len(another_argument)
message: an_argument must be longer than another_argument
-
check: ...
When a check is not True, the message is used to explain to the user why.
role:
optional the role for all jobs in thie process. This limits what the jobs are allowed to do.
role
parents:
- role URN or ID
- ...
policies:
- policy URN or ID
- ...
parameters:
value: expression
nextvalue: ...
parents:
policies:
parents:
's capabilites. parameters:
By default the job's role has the user's default role as its parent and, using the listed policies, filter down what is alloweds.
You can, instead, give a process your own list of parent roles and in this way your process can be given enhanced permissions which
the user running it would not normally be allowed. It's a bit like the 'S' bit on linux executables. The role owner needs to give
permission for their role to be used by a process, and this is done in Settings->Processes
.
jobs:
jobs:
<jobid>:
after:
runs_on:
role:
shells:
mapped_repo:
steps:
-
name:
condition:
ignoreerror:
workingdirectory:
timeout:
<shell>:
results:
jobs.<jobid>
jobs.<jobid>.after:
after:
to ensure that other job is finished first.jobs.<jobid>.runs_on:
Standard keys for runs_on:
:
jobs:
<jobid>:
runs_on:
host: svnplace
platform: linux
region: eu-west
host_instance: {repo.primary_host}
jobs.<jobid>.runs_on.host:
provider=svnplace
is the default. Your runners will have provider={user.username}
jobs.<jobid>.runs_on.platform:
linux
, darwin
.jobs.<jobid>.runs_on.region:
jobs.<jobid>.runs_on.host_instance:
Some tags, such as host_instance
, are only allowed for svnplace. If you need permission for your process to
give these, you will need to contact svnplace to create a role for your process to allow them.
jobs.<jobid>.role:
jobs.<jobid>.shells[name]: str
The default set of shells is:
shells:
bash: bash --noprofile --norc -eo pipefail {script}
python: python {script}
sh: sh -e {script}
{script}
is the file name of the script.
jobs.<jobid>.mapped_repo:
{}
substitutions are allowed. Only
svnplace is allowed this, your process would need an svnplace-originated role to be donated to use as a role parent. This is here
to support fundamental, site-foundational features like backup & restore. If you find you are unable to do something without it,
talk to svnplace - it is more likely the API and/or site will be extended to allow what you need than for this capability to be dontated to your process.jobs.<jobid>.steps:
jobs.<jobid>.steps[].name:
jobs.<jobid>.steps[].condition:
jobs.<jobid>.steps[].ignoreerror:
jobs.<jobid>.steps[].workingdirectory:
optional The working directory when the script is run, default /home/process. {}
substitutions are allowed.
jobs.<jobid>.steps[].timeout:
jobs.<jobid>.script[].<shell>:
Here is an example:
jobs:
somename:
steps:
-
bash: echo Hello {username}
-
python: |
print('Hello')
print('world')
The text is transfered to a file, which is passed to the matching shell. {}
substitutions are allowed.
jobs.<jobid>.script[].results:
results
:optional Which values to store as results of the job, and so be available to later jobs or as results for the run. See values for more details.
A dictionary of strings:
results:
compile_time: job.build.results.time
objects: job.build.results.objects
link_time: job.link.results.time
exes: job.link.results.exes
The default blob directory where run results are stored is Process Results/<run>/results/...
. Each variable is a file or tree of files, and is copied to the run's results.
The key and the value both allow {...}
substitutions.
If you want to change where results are stored, change process.output
found in Places
, in your, or your repository's Settings
.