summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseney300 <Arseney300@gmail.com>2026-02-20 01:59:35 +0700
committerArseney300 <Arseney300@gmail.com>2026-02-20 01:59:35 +0700
commitebddef6a320b219889152b594cfc7adef5f6764b (patch)
treecc7b21cce95cd0a2ff4b3311cdc4300fa588a50f
parent0136a15eb399d898c3ca68a836cd4d7c41c3c11e (diff)
Add example Jenkinsfile for DooD builds
Shows how to use different Docker images per stage in a Jenkins pipeline with Docker-out-of-Docker setup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-rw-r--r--doc/Jenkinsfile.example39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/Jenkinsfile.example b/doc/Jenkinsfile.example
new file mode 100644
index 0000000..15d43d0
--- /dev/null
+++ b/doc/Jenkinsfile.example
@@ -0,0 +1,39 @@
+// Example Jenkinsfile for DooD (Docker-out-of-Docker) builds
+// Jenkins spawns a temporary container with the specified image,
+// runs the build inside it, and cleans up when done.
+
+pipeline {
+ // Each stage can use a different Docker image
+ agent none
+
+ stages {
+ stage('Build') {
+ agent {
+ docker { image 'node:20' }
+ }
+ steps {
+ sh 'npm install'
+ sh 'npm run build'
+ }
+ }
+
+ stage('Test') {
+ agent {
+ docker { image 'node:20' }
+ }
+ steps {
+ sh 'npm test'
+ }
+ }
+
+ // Example: stage with a different image
+ // stage('Deploy') {
+ // agent {
+ // docker { image 'alpine:latest' }
+ // }
+ // steps {
+ // sh 'echo "Deploying..."'
+ // }
+ // }
+ }
+}