0
votes

We are planning to implement continuous integration with Jenkins software, so we successfully installed Jenkins in our server (windows platform)

My question was

  1. How can I manage (keep) my source code?

  2. How can we configure if the source code located in some other machine / server / cloud

Our current process

Jenkins, source code is available in same machine, so we created a project in Jenkins and map the pom.xml (like D:\pom.xml) file under build section.

3

3 Answers

1
votes

Choose a Version control tool, consider that SVN and GIT are quite different (Git--> Distributed system, SVN-> Centralized system) so read a bit about them before choose, then check for the availability of GIT/SVN plugin in Jenkins unless it already contained in your Jenkins installation.

Put the code under SVN/GIT, follow the standards, configure Jenkins in order to access to SVN/GIT server.

Check how to configure maven with Jenkins, it has a great integration with Maven.

Maven Jenkins: https://www.tutorialspoint.com/jenkins/jenkins_maven_setup.htm

Jenkins Git: Jenkins and Git sparse checkouts

The flow of the single build job is:

  1. Checkout The code,
  2. Specify the folder with the pom.xml file
  3. Run the maven goal you need (e.g. mvn install)
1
votes

You put your source code into Subversion or Git. Then you give your Jenkins access to the Subversion/Git and point it to the URL which you want to checkout.

1
votes

Answer to first question : Host your code in a SVN or GIT repository. Git has higher market share than SVN because of large feature set and higher efficiency. SVN is simple and easy to use for new comers in the version control territory. Explore the options and host the corresponding server in your infrastructure.

Answer to second question : There are multiple plugins available in Jenkins to fetch code from remote repositories. For git , there is git client, gitlab and gitHub plugin . For SVN there is Polarion webClient for SVN plugin.