CI/CD Pipelines: Containers, Services, and Environments/Run deploy only on deployment-capable agents
Target jobs to specific Jenkins workers or labels.
Section: Run with databases or environment-specific settings
Run deploy only on deployment-capable agents
groovy
groovy
stage('Deploy') {
agent { label 'deploy' }
steps {
sh './scripts/deploy.sh'
}
}Explanation
Dedicated deploy agents help isolate credentials, tools, and access for release operations.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Run with databases or environment-specific settings
Start PostgreSQL service for tests
Run integration tests against a service container.
Use named environments
Attach production jobs to an environment with protection rules.
Deploy a new image to Kubernetes
Update a deployment image and monitor rollout status.
Build and push Docker image with GitHub Actions
Authenticate, build, and push to a registry.