Posts

Showing posts from September, 2018

Jenkins pipeline clone and publish Git commit

I have been in a situation when a need to trigger CI/CD build on let's say repository B , on successful run of CI/CD build of repository A . It is worth to mention that CI/CD pipeline is built on OpenShift layer and executed by Jenkins server. So, what we have repository a with data science models, and repository B with microservice logic to execute these models (prediction, recommendation). To avoid data scientist to merge code from one repo to another I decided to use a Jenkins pipeline. Let's start from the beginning: the first step is to clone you second repository ( B) , if you will do it with command like: // Clone repo git url: 'https://github.com/jglick/simple-maven-project-with-tests.git' ... It won't work. Yes it will clone a repository, however it will overwrite you cloned repository A even, if you try to do it from different folder. That's why for cloning I used checkout functionality: // Clone repo checkout([$class: 'GitSCM',...