As part of your dynamic delivery definition, you can execute arbitrary commands in a docker image of your choosing via custom tasks.
Custom task definitions consist of:
- Program configuration (docker image, command, optioanlly env variables)
- The release channel to run the task in
- Optional retry configurations (never retry, retry X times, retry forever). The default is to never retry and fail the pipeline if the custom task fails.
To define a custom task:
# pvnctl applications create/edit ... pipelineTemplates: - nameSuffix: -push tasks: ... - customTask: program: image: <your docker image> cmd: <command to run in the image> env: <env variables and secrets> # optional releaseChannel: staging # run custom task in the runtime associated with the staging release channel ...
A common use for custom task is waiting on some external event to occur before moving on in the pipeline. This can be accomplished via retryConfig.
# pvnctl applications create/edit ... pipelineTemplates: - nameSuffix: -push tasks: ... - customTask: program: image: <your docker image> cmd: <command to run in the image> env: <env variables and secrets> # optional releaseChannel: staging retryConfig: retryForever: true # this will cause Prodvana to keep retrying the task until it succeeds, subject to backoff firstFailureNotification: # optionally send a notification on first failure (e.g. to prompt someone to take action) message: Waiting on <some external event> ...
firstFailureNotification will send a message to backend/channel specified in the application-level notifications settings.
It is better to have a custom task be short and rely on retryConfig than to implement the retry yourself in a long-running custom task.
Updated about 2 months ago