Jenkins change log when using multiple repositories - jenkins

We are using Jenkins pipeline for job executions and pipeline code is committed to subversion repository and checkout as Jenkins library. So whenever I execute job, it will look for changes at my pipeline code repository and publish the change logs. Changes committed to application source code repository is ignoring because of this reason. Do we have any options to specify which repository change logs should be published at Jenkins?

Related

Jenkins / Poll SCM : How to retrieve which SVN repository change triggered build job in declarative pipeline

I'm currently trying to set up a build job connected to multiple (3) svn repositories with single pipeline, with Poll SCM scheme. All the contents from the repositories build into a single artifact. Repositories are, e.g., say:
https://myrepo.com/mainSrc/main
https://myrepo.com/libs/library1
https://myrepo.com/libs/library2
When I set all this repos inside Pipeline configuration, the build job successfully checkouts all the paths to the workspace.
However, the point is, I need to track which repository started the build job, to write some conditional steps. Is there a solution for this? I googled for it, there are some ways to obtain svn revision for a path, however it's not what I'm looking for.

post-commit hook : run the jenkins job based on project changed in git repository

I have configured individual jenkins jobs for each project. in my case, whenever there is a commit, all the jobs are getting triggered. how do I make sure only that job pertinent to the project runs and creates the deployable artifacts.
What URL have you configured in GIT repo? Does it contain repo name? Does each project has it's own repository?
When you call curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the Git repository> jenkins will scan all the jobs that are configured to check out the specified URL. Do you have multiple jobs using the same repository?
You can try to use build triggers - you will be able to invoke a job by its name.

Jenkins Scripted Pipeline to trigger from changes in git directory

I need code to jenkins scripted pipeline where I can say that pipeline is only allowed to trigger from changes in git directory and not from changes in whole repository to avoid useless triggers.
Thanks!
I understand that you want your pipeline to run only when changes are detected for a specific sub directory in your Git repository, but not for changes only affecting files outside that directory.
Theoretically, the PathRestriction class that could be used with the checkout step would offer this through includedRegions and excludedRegions.
Unfortunately, this is not working for Git in Jenkins Pipeline, see JENKINS-36195.

Usage of SVN private repository with Jenkins instead of GIT

I am keeping all my code in SVN repository within my on-premise server. And also I am trying to implement the CI/CD pipeline for deploying my application. I am trying to use Kubernetes and Jenkins tools for implementing this. When I am exploring the implementation examples of CI/CD pipeline using Jenkins and Kubernetes, I am only seeing example with GIT repository and managing code commits using Webhooks.
Here my confusion is that, I am using SVN code repository. So How I can use my SVN code repository with Jenkins Pipeline Job ? Do I need to install any additional plugin for SVN ? My requirement is that, when I am committing into my SVN code repository, Jenkins need to pull code from code repo and need to build project and need to deploy in test environment.
Hooks to trigger Jenkins from SVN are also possible. Or you can poll the repository for changes - the Jenkins SVN plugin supports both methods (https://wiki.jenkins.io/display/JENKINS/Subversion+Plugin). The examples you are looking at will have a step that does a build from the source code of a particular repo. You should be fine to swap git for SVN and still follow the examples as where and how the source is hosted is not normally related to how to use Jenkins to build and deploy it.

Jenkins | Checkout SCM repository to a remote machine

I got a jenkins job, which checkouts repository #1, builds the code and execute it.
During execution, my code uses another code repository (#2), which located on a remote server and my code can access it easily.
I would like to have the jenkins job checkout the latest code on both repositories #1 and #2, whereas repo #2 should be checked out into a remote server. And I'd be happy to avoid scripts and git hooks.
I agree with #Slav, you can use Multiple SCM plugin which will allow you to checkout code on different SCM systems.

Resources