Skip to main content

Checksum hook

The checksum hook calculates a checksum from a specified directory. The checksum is calculated recursively, i.e. all files and directories under the specified directory are included in the checksum.

Properties

Here are the properties of the Checksum hook:

KeyRequiredTypeDescription
typeyesstringType of the hook, this must be checksum.
nameyesstringName of the hook.
diryesstringPath to the directory from where the checksum should be calculated. The path can be absolute or relative to the project directory.
encodingnostringEncoding used to encode the calculated checksum. Supported values are base64 (default) and hex.
operationnostringOperations during which the hook should be executed. Supported operations are: create, update, delete. Accepts a single operation or a list of operations. By default, a hook is executed on every operation.
stagenostringStages during which the hook should be executed. Supported values are: before, after. Accepts a single stage or a list of stages. By default, a hook is executed on every stage.
statusnostringStatuses during which the hook should be executed. Available on when stage is after. Supported values are: success = The operation succeeded, failed = The operation failed, cancelled = The operation was cancelled. By default, a hook is executed on every status.

Examples

Calculate a checksum from a directory lambda/scripts located in the project directory.

- name: my-checksum
type: checksum
dir: lambda/scripts

The same as above but using the hex encoding.

- name: my-hex-checksum
type: checksum
dir: lambda/scripts
encoding: hex