sqitch-add-step - Add a deployment step


  git [options] add-step [<template-options>] name


Add a new deployment step. This will result in the creation of a new script files with the --extension extension in the --deploy-dir, --revert-dir, and --test-dir directories. The content of these files is determined by the evaluation of templates. By default, system templates in $(etc_path)/templates are used. These can be overridden by a single user by creating templates in ~/.sqitch/templates/ See "Templates" for details.



Name of a step that is required by the new step. May be specified multiple times.


Name of a step that conflicts with the new step. May be specified multiple times.


Set a variable name and value for use in the templates. The format must be name=value, e.g., --set comment='This one is for you, babe.'.


Location to look for the templates. If none is specified, add-step will first look in ~/.sqitch/templates/ for each template, and fall back on $($etc_prefix)/templates.


Path to the template for the given step script. Defaults to the individual templates found in --template-directory.


Do not generate the named script.


Generate the named script. These are not mutually exclusive.


Sqitch contains a very simple set of templates for generating the deploy, revert, and test scripts. By default, it uses system-wide templates installed in ($etc_path)/templates; call sqitch --etc-path to find out where, exactly. Individual templates may be overridden on a user bases by copying templates to ~/.sqitch/tempates and making modifications. They may also be overridden by using the --tmplaet-directory option, as well as the template-specific options.


The syntax of the templates is the very simple but limited language provided by Template::Tiny, which is limited to:

[% %]

This is the directive syntax. By default, the return value of the expression is output:

  -- Deploy [% step %]

You can add - to the immediate start or end of a directive tag to control the whitespace chomping options:

  [% IF foo -%]    # remove trailing newline
  We have foo!
  [%- END %]       # remove leading newline
[% IF %]
[% IF %] / [% ELSE %]
[% UNLESS %]

Conditional blocks:

  [% IF transactions  %]
  [% ELSE %]
  -- No transaction, beware!
  [% END %]
[% FOREACH item IN list %]

Loop over a list of values:

  [% FOREACH item IN requires -%]
  -- :requires: [% item %]
  [% END -%]


Sqitch defines three variables for all templates. Any number of additional variables can be added via the --set option, like so:

  sqitch add-step --set transations=1 --set schema=foo

Any number of variables may be specified in this manner. You may then use those variables in custom templates. Variables that appear multiple times will be passed to the templates as lists of values for which you will likely want to use [% FOREACH %]. If the templates do not reference your variables, they will be ignored. Variables may also be specified in a [add-step "variables] config section (see "Configuration Variables"). Variables specified via --set will override configuration variables.

The three core variables are:


The name of the step being added.


A list of prerequisite steps as passed via one or more instances of the --requiers option.


A list of conflicting steps as passed via one or more instances of the --requiers option.

Configuration Variables


Directory in which to find the templates which should be named deploy.tmpl, revert.tmpl, and test.tmpl. This will override looking for user- or system-specific templates, and may in turn be overridden by the --template-directory, --deploy-template, --revert-template, and --test-template options.


Boolean variable indicating whether or not to generate the specified script when adding a step. They are all enabled by default. If you've disabled them but wish to create them for a given call to add-step, use the appropriate option: --deploy, --revert, or --test.


Location of individual templates. My be overridden by the appropriate option: --deploy-template, --revert-template, or --test-template.


A section defining template variables. Useful if you've customized templates with your own variables and want project-, user-, or system-specific defaults for them.


Unless explicitly told where to find templates via --template-directory or, as appropriate, --deploy-template, --user-template or --test-template, Sqitch looks in two locations for templates: A system-wide location and a user-specific location:


The system-wide templates for creating deploy, revert, and test scripts.


User-specific templates to override the system-wide templates.


Part of the sqitch suite.