YAML for Custom Build

Execute shell commands in a Docker container. The most common action type for building, testing, and deploying applications.

YAML parameters for Custom Build

PARAMETERS
execute_commandsrequiredstring[]
The commands that will be executed.
docker_image_namerequiredstring
The name of the Docker image.
typerequiredstring

Value: BUILD

actionrequiredstring
Unique identifier for the action within the pipeline.
integrationstring
Integration identifier for cloud provider authentication.
regionstring
Cloud region for the build (when using cloud integrations).
working_directorystring
The directory in which the pipeline filesystem will be mounted.
setup_commandsstring[]
The command that will be executed only on the first run.
cached_dirsstring[]
The dependencies and directories to be cached and available to every execution in this pipeline.
shellstring enum
The name of the shell that will be used to execute commands.
Allowed enum:
SH,
BASH,
POWERSHELL
execute_every_commandboolean
If set to true all commands will be executed regardless of the result of the previous command.
volume_mappingsstring[]
The path preceding the colon is the filesystem path (the folder from the filesystem to be mounted in the container). The path after the colon is the container path (the path in the container, where this filesystem will be located).
main_service_namestring
The hostname of the container in which the action is run. The container will be available under this name in the docker network for services.
run_as_userstring
All build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
cache_base_imageboolean
If set to true, the cached version of the image is used, instead of being pulled each time.
ignore_image_pull_failuresboolean
If set to true, use cached image on timeouts (only for official images).
docker_image_tagstring
The tag of the Docker image.
image_locationstring enum
The location of the image used by the action.
Allowed enum:
PUBLIC_REGISTRY,
PRIVATE_REGISTRY,
ACTION,
ARTIFACT_REGISTRY
docker_registrystring enum
The type of registry from which the image is retrieved.
Allowed enum:
NONE,
DOCKER_HUB,
AMAZON_ECR,
GOOGLE_GCR,
GOOGLE_ARTIFACT_REGISTRY,
OTHER,
GIT_HUB_CONTAINER_REGISTRY,
ARTIFACT_REGISTRY,
DIGITAL_OCEAN_CONTAINER_REGISTRY
artifactstring
The identifier of the artifact from artifact registry.
versionstring
The version of the artifact from artifact registry.
use_image_from_actionboolean
If set to true, the image from another action will be used.
docker_build_action_namestring
The name of the action from which the Docker image will be used.
registrystring
The URL of the Docker registry.
loginstring
The username for the Docker registry.
passwordstring
The password for the Docker registry.
servicesServiceYaml[]
The list of services attached to the build environment.
trigger_timestring enum
Specifies when the action should be executed.
Allowed enum:
ON_EVERY_EXECUTION,
ON_SUCCESS,
ON_FAILURE,
ON_BACK_TO_SUCCESS,
ON_WARNING,
ON_WAIT_FOR_APPROVE,
ON_TERMINATE
loopstring[]
The list of variables for dynamic action execution. The action runs once for each value.
run_only_on_first_failureboolean
Defines whether the action should be executed on each failure. Restricted to and required if the trigger_time is ON_FAILURE.
disabledboolean
When set to true the action is disabled. By default it is set to false.
timeoutinteger
The timeout in seconds.
ignore_errorsboolean
If set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions.
retry_intervalinteger
Delay time between auto retries in seconds.
retry_countinteger
Number of retries if the action fails.
run_nextstring enum
Defines whether the action should run in parallel with the next one.
Allowed enum:
WAIT_ON_SUCCESS,
IN_SOFT_PARALLEL,
IN_HARD_PARALLEL
trigger_conditionsTriggerConditionYaml[]
The list of trigger conditions to meet so that the action can be triggered.
variablesVariableYaml[]
The list of variables you can use in the action.

Last modified on Jul 31, 2025

YAML examples for Custom Build

Build with Docker services and caching

yaml
- action: "Build application" type: "BUILD" trigger_time: ON_EVERY_EXECUTION working_directory: "/buddy/my-repo-dir" docker_image_name: "library/ubuntu" docker_image_tag: "$tag" execute_commands: - "ls -al > ls.log" setup_commands: - "apt-get update -y" - "apt-get install -y wget" main_service_name: "my-app.svc" services: - type: "MYSQL" version: "5.7" - type: "MONGO_DB" version: "3.2.4" cached_dirs: - "/build/test" - "/bin/Debug" shell: "SH" cache_base_image: true variables: - key: "tag" value: "latest"

Minimal build with npm

yaml
- action: "Execute: npm test" type: "BUILD" docker_image_name: "library/node" docker_image_tag: "6" execute_commands: - "npm install" - "npm test"

Build with private Docker registry

yaml
- action: "Build application" type: "BUILD" docker_image_name: "buddyworks/private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "DOCKER_HUB" execute_commands: - "ls -al > ls.log" integration: "my_integration"

Build with volume mappings

yaml
- action: "Build Android app" type: "BUILD" working_directory: "/buddy/yaml-project" docker_image_name: "library/openjdk" docker_image_tag: "8" execute_commands: - "chmod +x gradlew" - "./gradlew assembleRelease" volume_mappings: - "/:/buddy/mount/directory"

Using image from Google Container Registry

yaml
- action: "Build application" type: "BUILD" docker_image_name: "tokyo-house-147623/private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "GOOGLE_GCR" execute_commands: - "ls -al > ls.log" registry: "my.gcr.com" integration: "my_integration"

Using image from Amazon ECR

yaml
- action: "Build application" type: "BUILD" docker_image_name: "private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "AMAZON_ECR" execute_commands: - "ls -al > ls.log" region: "us-east-1" integration: "my_integration"

Using image from GitHub Container Registry

yaml
- action: "Build application" type: "BUILD" docker_image_name: "private_image" docker_image_tag: "latest" image_location: "PRIVATE_REGISTRY" docker_registry: "GIT_HUB_CONTAINER_REGISTRY" execute_commands: - "ls -al > ls.log" integration: "my_integration"

Using image built in previous action

yaml
- action: "Build application" type: "BUILD" docker_image_name: "library/ubuntu" docker_build_action_name: "Build Docker image" image_location: "ACTION" execute_commands: - "ls -al > ls.log"

Using image from artifact registry

yaml
- action: "Build with artifact registry" type: "BUILD" docker_image_name: "ubuntu" docker_image_tag: "22.04" image_location: "ARTIFACT_REGISTRY" artifact: "my-docker-image" version: "latest" execute_commands: - echo "Hello"