Skip to main content

Executors

Docker

The docker executor is used to build and push docker images.

schema
export interface DockerExecutorSchema {
tag: string;
branch?: string;
images: {
name: string;
dockerfile: string;
target?: string;
}[]
}
project.json
{
"targets": {
"docker": {
"executor": "@tsm/nx-tools:docker",
"options": {
"images": [
{
"name": "first-image-name",
"dockerfile": "path/to/Dockerfile",
"target": "production" // optional
},
{
"name": "second-image-name",
"dockerfile": "path/to/Dockerfile",
"target": "production" // optional
}
]
}
}
}
}
command
nx run app-name:docker --tag=latest --branch=main

Deploy

The deploy executor is used to deploy applications to environments.

export interface DeployExecutorSchema {
sourceTag: string;
destinationTag: string;
deployments: {
name: string;
image: string;
}[];
namespace: string;
kubeConfig: string;
}
project.json
{
"targets": {
"deploy": {
"executor": "@tsm/nx-tools:deploy",
"options": {
"deployments": [
{
"name": "first-image-name",
"image": "first-deployment-name"
},
{
"name": "second-image-name",
"image": "second-deployment-name"
}
]
}
}
}
}
command
nx run app-name:deploy --source-tag=main --destination-tag=latest --namespace default