Created
May 14, 2023 20:37
-
-
Save naturalett/366ef9e4dcfefd56b4231a540918d16c to your computer and use it in GitHub Desktop.
Run a Containerized Jenkins Environment with Docker Agent for Seamless Integration!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
docker { | |
image 'docker:19.03.12' | |
args '-v /var/run/docker.sock:/var/run/docker.sock' | |
} | |
} | |
stages { | |
stage('Clone') { | |
steps { | |
git branch: 'main', url: 'https://github.com/naturalett/hello-world.git' | |
} | |
} | |
stage('Build') { | |
steps { | |
script { | |
docker.build("hello-world") | |
} | |
} | |
} | |
} | |
post { | |
success { | |
script { | |
currentBuild.description = "Passed successfully!" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment