Back to Home

Continuous Cloud Integration / Jelastic Blog

java · continuous integration · jenkins · maven · paas · platform as a service · platform as a service · tomcat · subversion · plugin · repository · jelastic · ci

Continuous Cloud Integration

  • Tutorial
Recently, developers are increasingly turning to us with requests to implement CI in Jelastic. Why is continuous integration necessary? As a rule, in a project where developers work independently on different parts, the integration stage is final and rather laborious, and accordingly requires additional time. The transition to continuous integration can reduce this complexity, as well as detect and eliminate errors in advance, while they are not yet rooted and have grown into a more serious problem. Indeed, if you carry out quality control throughout the development process, you can save time, money and effort, while improving quality. This approach is especially useful for large projects involving a large number of developers.

Today we show how continuous integration can be implemented in the Jelastic cloud using a simple example using Jenkins .

Step-by-step instruction:

1. Create an environment in Jelastic and deploy Jenkins in it (or deploy it locally on your computer). You can deploy your application in the same environment or create another one separately.

2. Now you need to slightly modify the files of your project: settings.xml and pom.xml in order to use the Maven plugin for Jelastic.

Write the profile tag in the settings.xml file and specify your Jelastic dashboard username and password:

      jelastic
      
        true
      

      
        [insert your Jelastic username]
        [insert your Jelastic password]
      


Now add the Plugin Repository section to pom.xml , specify the path to the repository where the Jelastic Maven plugin is stored:
 
        
          sonatype-oss-public
          https : //oss.sonatype.org/content/groups/public
          
            true
          

          
            true
          

        


Also in pom.xml write down the plugins section , into which you need to add a plugin to automatically deploy the application in the previously created environment:



 com.jelastic
 jelastic-maven-plugin
 1.7-SNAPSHOT
 
   $ {jelastic.username}
   $ {jelastic.password}
  
  
  
 




In tag specify the appropriate hoster API .

3. Open Jenkins and the browser and install Maven automatically.

image

4. Create a new project.

5. On the Configuration page, in the Source Code Management section, select Subversion and enter the URL to your repository.
You can also poll your system for changes after a certain period of time. To do this, fill in the appropriate field.

6. In the Build section, specify Root pom ( pom.xml ). In the Goals and Options field, enter the following line:

clean install jelastic: deploy

This will allow you to deploy your application in Jelastic automatically.

image

That's it! Now just click Build now and your project will be automatically built and deployed in the cloud. And Jenkins will poll the system for changes made according to your specified time period.

We will be very grateful for the feedback and suggestions for improving this functionality.

Read Next