Overview
Docker tasks are return a promise that resolves when the task is complete, if there are unawaited exec promises, we'll wait for them to complete before resolving the task.
Usage without a job - You can run tasks without wrapping with a job. We'll still create a default job with the "ubuntu-4x" runner for you.
Example
Volume Mounting
You can mount Docker volumes by passing an array of volumes to the volumes
option.
Repo volume - We always mount the repository root as /home/pandaci/repo.
This volume is a bind mount, so all tasks in the same job will see the same files.
Volumes must be only be created inside a job, and they are only accessible to tasks in the same job.
Methods
docker.if
The if
method allows you to skip a docker task based on a condition.
docker.nothrow
The nothrow
method allows you to suppress errors if the condition is met.
docker.skip
The skip
method allows you to skip a docker task if the condition is met.
Docker options
- name - The name of the task. Defaults to the name of the function.
- skip - Skip the task if the condition is met. Defaults to false.
- throws - Throw an error if the condition is met. Defaults to true.
- volumes - An array of volumes to mount in the container.