Stage Types
Learn about the different stage types available in Sluice pipelines.
Stage Types
Sluice pipelines support several stage types, each designed for a specific purpose in your CI/CD workflow.
Source Stage
The source stage clones your code from a Git repository. It’s typically the first stage in a pipeline.
- name: source
type: source
config:
repository: https://github.com/your-org/your-repo
branch: main Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
repository | string | Yes | Git repository URL (HTTPS or SSH) |
branch | string | No | Branch to clone (default: main) |
tag | string | No | Specific tag to checkout |
commit | string | No | Specific commit SHA to checkout |
path | string | No | Subdirectory to use as workspace root |
depth | number | No | Clone depth (default: 1 for shallow clone) |
Authentication
For private repositories, configure credentials:
config:
repository: [email protected]:your-org/private-repo.git
credentials:
type: ssh
secretRef: git-ssh-key Build Stage
The build stage creates container images using Docker.
- name: build
type: build
config:
dockerfile: ./Dockerfile
context: .
image: registry.example.com/my-app
tag: latest
push: true Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
dockerfile | string | Yes | Path to Dockerfile |
context | string | Yes | Build context directory |
image | string | Yes | Image name (without tag) |
tag | string | No | Image tag (default: latest) |
buildArgs | object | No | Build-time variables |
target | string | No | Target stage for multi-stage builds |
push | boolean | No | Push to registry after build (default: true) |
cache | boolean | No | Use layer caching (default: true) |
Build Arguments
Pass build-time variables:
config:
dockerfile: ./Dockerfile
context: .
image: my-app
buildArgs:
NODE_ENV: production
API_URL: https://api.example.com Note
Test Stage
The test stage runs automated tests against your code.
- name: test
type: test
config:
image: node:18
commands:
- npm ci
- npm test Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Container image to run tests in |
commands | array | Yes | List of commands to execute |
workdir | string | No | Working directory (default: /workspace) |
env | object | No | Environment variables |
timeout | string | No | Test timeout (default: 30m) |
Parallel Testing
Run multiple test suites in parallel:
- name: test
type: test
config:
parallel:
- name: unit
image: node:18
commands:
- npm run test:unit
- name: integration
image: node:18
commands:
- npm run test:integration Deploy Stage
The deploy stage pushes your application to infrastructure.
Kubernetes Deployment
- name: deploy
type: deploy
config:
type: kubernetes
namespace: production
manifests:
- ./k8s/deployment.yaml
- ./k8s/service.yaml
wait: true Helm Deployment
- name: deploy
type: deploy
config:
type: helm
chart: ./charts/my-app
release: my-app
namespace: production
values:
replicaCount: 3
image:
tag: '{{.Version}}' Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Deployment type (kubernetes, helm) |
namespace | string | No | Target namespace |
manifests | array | Conditional | Kubernetes manifest files |
chart | string | Conditional | Helm chart path or repo |
release | string | Conditional | Helm release name |
values | object | No | Helm values to override |
wait | boolean | No | Wait for rollout (default: true) |
timeout | string | No | Rollout timeout |
Approve Stage
The approve stage pauses the pipeline for manual approval.
- name: approve-production
type: approve
config:
message: 'Deploy to production?'
approvers:
- [email protected]
timeout: '24h' Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
message | string | No | Message shown to approvers |
approvers | array | No | List of allowed approvers |
timeout | string | No | Time before auto-rejection |
autoApprove | object | No | Auto-approve conditions |
Auto-Approval
Automatically approve based on conditions:
config:
message: 'Deploy to staging?'
autoApprove:
branches:
- develop
- feature/* Warning
Stage Ordering
Stages run sequentially in the order they’re defined. Each stage starts only after the previous stage completes successfully.
stages:
- name: source # Runs first
type: source
- name: build # Runs after source
type: build
- name: test # Runs after build
type: test
- name: approve # Runs after test
type: approve
- name: deploy # Runs after approval
type: deploy Next Steps
- Configuration Reference - All configuration options
- Variables - Using environment variables