yuval.guide
In the previous post (multibranch basics) we have described the basics of creating and using a multibranch pipeline (well, building was manual for each branch, which is not too practical). In this post, we will learn how to trigger builds for branches using github webhooks. Plugins invalved The trigering and handling a …
Read MoreMultibranch Pipelines These pipelines automatically "build" the code for each branch that has a Jenkinsfile in it. For example: In a feature branch, you may want to prepare (build image? run container?) and run unit tests alone in a develop branch, you may want to prepare more, and run some integration tests as well in …
Read MoreIn the previuos post we have create smee.io infrastructre that can be used to deliver push notification from Github to Jenkins. Now we can go to Github and Jenkins to configure those webhooks. Github Plugin There are several plugins that can receive webhooks in Jenkins. Generic Webhook Trigger Gitlab Plugin Job trigger …
Read MoreWe start our journey towards a full example where we use github webhooks to trigger a build in a single branch pipeline. The big picture This is what we want to achieve (see notes below): We want to configure GitHub to use webhooks to send notifications about change in repository (git push) Unfortunatelly, my computer …
Read MoreIntroduction Jenkins Terms Jenkins GUI Jenkins Freestyle Job Jenkins installation jenkins all in docker 1 jenkins all in docker 2 Pipelines Pipelines Primer 1 Pipelines Primer 2 Scripted Pipelines Declarative Pipelines Docker Agent Environment variables Multibranch Pipelines Multibranch Basics Triggering Multibranch …
Read MoreIn the previous post , we have created a docker:dind container, a smart container that has docker installed inside, can store docker images, and run internal containers. In this post we'll use it as a jenkins agent from a Jenkins controller (also a container), so that Jenkins could run docker agent stages and …
Read MoreThis post is based on these instructions . How to run everything in docker containers We are using a unique configuration, where the Jenkins controller+agent are running in a docker container. The basic Jenkins image we can use is jenkins/jenkins image. The problem with this image is that the Jenkins agent included …
Read MoreWhat is a docker agent? How can we create one and use it? We'll explore this on the next post(2) What is a docker agent Let's say that I want to run some nodejs javascript code. I don't want to really install nodejs on any of my agents. Can I use docker? Yes!!! I can specify a docker agent in my pipeline. Jenkins will …
Read MoreHere's an example of a file with environment variables: 1pipeline { 2 agent any 3 4 environment { 5 globalvar = 'global' 6 } 7 8 stages { 9 stage('stage1') { 10 environment { 11 localvar = 'local' 12 } 13 steps { 14 echo localvar 15 echo globalvar 16 } 17 } 18 stage('stage2') { 19 steps { 20 echo localvar 21 echo …
Read MoreDeclarative pipelines were created to allow users create pipelines without learning Groovy programming. Declarative pipeline example Create a new pipeline, as we've done in pipelines-primer-1 post ...but... Choose GitHub + Maven example, which is the same as the one we have covered in scripted-pipelines , but using a …
Read More