Tag Archives: ci/cd

Jenkins email-ext RequesterRecipientProvider always empty

This one was hard to track down. I couldn’t figure out why email-ext [$class: ‘RequesterRecipientProvider’] kept being empty on my declarative pipeline. Looking at console output for given run, printed message was: Not sending mail to user noreply@github.com with no permission to view……An attempt to send an e-mail to empty list of recipients, ignored. Luckily, i finally found this post: https://issues.jenkins-ci.org/browse/JENKINS-4350 If you have a similar setup, i.e. Github + (multi-branch) pipeline + email-ext, then odds are that you need to do the following: in Jenkins, click on your pipeline > Configure Go to section “Branch Sources” > Github > […]

Building a CI/CD pipeline for a microservice application

Building a CI/Cd pipeline for microservice application is easier said than done. On our side, here have been the choices made so far: each microservice has its own git repository (isolation of services) each microservice is designed to be stateless (scalability) – except for db service obviously testing is made of unit-tests (i.e. standalone tests) and integration tests on Git side, we try to keep things simple by doing following: use a feature-branch flow “master” is stable branch, only pushable by Jenkins (our ci tool) each new dev starts with a feature branch and get merged into master through pull-requests […]

Configure Jenkins for sending email

Below are steps to configure Jenkins for sending email Configure SMTP configuration Go to Jenkins > Manage Jenkins > Configure System Find section “E-mail Notification” Fill up required details based on your own SMTP configuration parameters SMTP Server: smtp.server.com Use SMTP Authentication: checked User Name: user@email.com Password: ******* Use SSL: checked SMTP port: 465 (or your smtp port if different) Click on “Apply” Note that “from” address in sent email is set to “System Admin e-mail address” defined in “Jenkins Location” section. You may want to edit that one to match your expectation. Immediately test sending an email using option […]

Setup github webhooks for jenkins

This post describes required steps to setup up github webhooks for jenkins so that builds start upon github repository actions. Pre-requisites You have a github account and a repository defined there Jenkins is up and running and accessible from web In case of private repository, you may want to read configure jenkins to log in into Github Configure github log into your github account select your repository > Settings > Webhooks > add new webhook configure your webhook as per below: append “/gihub-webhook/” to end of your jenkins url choose type “application/json” select events “Pull requests” and “Pushes” flag your […]

Configure Jenkins to log into Github account

By default, Jenkins is connecting anonymously to github account. Although this setting is fine to start with, it quickly becomes a limitation when dealing with private repos and when timeouts on anonymous users are triggered on Github side. This post details steps to configure Jenkins and Github to allow Jenkins to authenticate on Github. Approach There are several ways of authenticating, which are all more or less described in https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys It is possible to: ssh through your own account use authentication token with oauth api on your own account setup ssh “deploy keys” on a per repository basis use a […]

Configure user access rights on Jenkins

This post is continuing upon “how to allow users to authenticate using their github credentials“. Note that it is not a pre-requisite, users can login using other login functionality (jenkins credentials, LDAP, …) – see jenkins documentation for more information on that part. For this section, I would recommend setting up Role-based Authorization Strategy Plugin. This plugin will allow to define notion of “roles”, assign rights to roles and user to roles. Follow plugin instructions on how to install this plugin into your jenkins app. Possible access rights restriction Let’s go to your Jenkins app > Configure Global Security > […]

Login into jenkins with your github credentials

Github Oauth Plugin is to allow users to log in your jenkins app using their github account credentials (initially i thought it was to authenticate jenkins app on github) Follow plugin instructions, i.e.: In your Github account Go to Settings > Developer settings > Oauth App > New oauth App Configure your app as per documented name: Jenkins homepage: url to your jenkins app (it does not really matter though) authorization callback url: <your_jenkins_app_url:port>/securityRealm/finishLogin “callback setting” is the important one Write down generated “Client-ID” and “Client-Secret”, they will be needed on Jenkins side In your jenkins app Now it is […]