Jenkins Build CI/CD deployment from SVN repository - jenkins

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?

Related

Can I use a gitlab-ci.yml with a Bitbucket repo to create a pipeline?

So we migrated all our Gitlab projects to Bitbucket. We'd like to use the existing gitlab-ci.yml files for Bitbucket pipelines. Could we do that? If yes, could someone please give some steps to carry that out?
Thanks!
No, you can not, recently I did the same job and I wrote all the pipeline yamls from scratch. They don't behave the same.
Gitlab supports mirroring repositories between git servers, but it’s only free for public/open source repositories. Otherwise you have to be on a paid plan, regardless if you use gitlab.com or an on-premise installation. Pushing from Gitlab to another server is free, but pulling from elsewhere to Gitlab is a Premium feature. You can read more about this in the docs
Otherwise, there are open source utilities that will mirror repositories for you but they have to be configured and maintained properly. One such utility is gitlab-mirror.

How to check whether a GitHub repository uses Continuous Integration, and which CI platform (e.g. Jenkins, Travis CI)?

Is there a simple way to check whether a repository uses continuous integration, and which CI platform (e.g. Jenkins, Travis CI)?
Example: OpenCV. See https://github.com/opencv/opencv. By skimming through the repo, I have no idea whether CI is used (although I supposed so), and what kind of CI it uses.
Most CI platforms use a configuration file or directory placed at the root of the repository. It probably the quickest way to identify the tool used by each repo. Here are a few examples:
.travis.yml for Travis
.gitlab-ci.yml for Gitlab
.drone.yml for Drone CI
.circleci/ for CircleCI
.github/workflows for Github
Jenkins situation is slightly more complex since users can have a Jenkinsfile directly in there repository or not.

What is the best practice for CI development?

We are starting to develop CI workflow for our systems in my company.
Currently we just making few basic tasks like build, tests, and upload to Nexus.
The tech stack is a Java project which build in Gradle and Jenkins makes our build.
Currently i'm working with some basic Groovy script to make what we need, but each time i'm copy and paste my updated code to Jenkins and running the job from Jenkins UI to see the results, and to me it seems like not a very good approach for developing such automation code.
My question is, what is the best practice to build and run Jenkins jobs?
Is it possible to run it straight from Intellij ?
Do we need to create a Jenkins project which should be saved as a repository and then deploy it to Jenkins machine?
Do we need to use some Intellij plugins in order to work with Jenkins?
More best practices are welcome :)
Jenkins has an API - so you can do whatever you want!
But in general, for small to medium teams it's better to use Jenkinsfile and let Jenkins pull code changes (or pull-requests) from SCM and trigger builds. You can also configure hooks to trigger builds if your SCM supports this (Github & bitbucket supports this).
If you are eventually pushing your artifacts to a docker image, I would highly recommend docker multi-stage builds.
If you are completely new to CI/CD stuff - Atlassian has a lot of good resources https://www.atlassian.com/continuous-delivery/principles/continuous-integration-vs-delivery-vs-deployment

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.

Does Sonatype's Nexus Repository offer any benefit with Jenkins?

So I'm setting up a CI solution using Jenkins and I've been instructed to use SonaType's Nexus Repository as a binary repository that ties into Jenkins. The idea as I understand is that it will provide immediate rollback to previous compiled binaries.
Some of the other engineers who have experience with Jenkins have questioned this decision, because they believe Jenkins can already do this. Apparently Jenkins will store build results for immediate rollback deployment anyway, so the inclusion of Nexus is of dubious benefit.
Is it true that Jenkins can already offer immediate rollback without a third-party service or plugin? If so, what is the benefit of using Nexus with Jenkins if any?
One of the benefits of use an artifact repository (Nexus, Jfrog Artifactory..) with Jenkins(or another CI tool like Bamboo) is that you can deploy your artifacts to a repository in Nexus(or Artifactory) with their control version (include SNAPSHOT in maven) previously to send these artifacts to each environment (integration environment, production environment...).
This is a good practice because when you do an install of your projects, for example:
mvn install
Your projects downloads all dependencies from the artifact repository (Nexus, Artifactory...) and theses dependencies are organized and availables for al your team.

Resources