Usage of SVN private repository with Jenkins instead of GIT - jenkins

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.

Related

Jenkins Build CI/CD deployment from SVN repository

Basically I am trying to implement an automated Jenkins pipeline. which will automatically build and test my codes from SVN repository. The pipeline has to be set such that, it riggers a test and build each time a code is committed to the SVN repository. All the servers are on premises. I am trying to implement a Jenkins Build and CI/CD pipeline concept with SVN as my Source code repository. This is my requirement.
I am new to SVN and on premises servers. My expertise are in with Git and Github, Terraform and AWS Cloud platform. So I must say I am lost with this one.
I have ben doing some research and mostly found things on Github and Cloud platforms with Jenkins. Which is exactly opposite what I want.
How do I go about this? Is there any good, clear concise documentation I could use? or video? or tutorials?

How to clone a bitbucket source code repository using credentials in Jenkins

I am using Jenkins with my Linux box. I have two bitbucket repositories. I am trying to create a Jenkins pipeline.
Repo_A - Jekinsfile resides here.
Repo_B - Project's source code resides here.
I want Jenkins to take configurations (Jenkinsfile) from Repo_A. Also, I want Jenkins to clone my source code to /some/random/directory. The credentials are stored in Jenkins, and can be used for both repos.
How can I use multiple repos in a single pipeline? Can somebody please tell me how to do this?
You need to use ssh authentication, it is suported by Genkins
Here is similar question: how to setup ssh keys for jenkins to publish via ssh
To add new repository

Pipeline by using Jenkins with private SVN repository

I am trying to implement CI/CD pipeline for my microservice oriented project by using Kubernetes and Jenkins. I am using my code repository on my on-premise server. I created one SVN repository on my server.
I am interested to know, can I use my private SVN code repository with Jenkins?
The reason for my doubt is because every example is showing the creation of pipeline with Jenkins and GitHub project.
You can use the shell command in your pipeline. So you are free to use SVN with Jenkins:
https://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-cli-main.html
Some info there:
Run bash command on jenkins pipeline

Triggering CI builds using Jenkins on remote build machine

I am trying to implement CICD with Jenkins. I have my code in git repo. The moment I make a change to git repo files, I wish to trigger a Build that should run on remote machine.
This means If I change a file in Git Repo 10 times, I should have 10 Builds, each build corresponding to one change.
Can anyone tell me how this can be done ?
I tried to make use of post-commit hook, but its not working.
What flavor of GIT? Do you use? If you share you config details of webhook and Jenkins additional info can be provided. Per my experience it is a two step process.
Enable the webhook in GIT
Create a job with appropriate configuration to map to the repository and get triggered on commit

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