Before starting the discussion on How Jenkins is helping IT professionals in automation let’s discuss the little bit on Jenkins. Jenkins is a Java-based open source tool. It is a Continuous Integration server. Jenkins helps to automate the non-human part of the software development/Software testing process, with continuous integration and facilitating technical aspects of continuous delivery. It is a server-based system that runs in servlet containers such as JBoss. It supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase and RTC, and can execute Apache Ant, Apache Maven etc based projects as well as arbitrary shell scripts and Windows batch commands.
Now the question is how Jenkins is helping in Automation??
If we enlighten on automation, automation is taking lead in every process whether it is the process of software development or establishing the IT infrastructure on Cloud platforms or in DevOps field. If we talk about the testing phase of software development cycle, we can execute the maven based project of Selenium web driver which we write in Eclipse IDE or Maven projects which are shared with development team through shared repository like Git based or SVN based. What we need to do for this:
- First, we need to create item/job in Jenkins which will be Maven based project.
- We need to provide some more info like the description of Job, Discard old builds etc
- Now we need to source code management that can be a local repository or it can be a remote shared repository
- There will more options like Build Triggers, Build Environments, Pre-steps etc, You can set up these things based on your requirements
- Now in Build section on the item, we need to provide POM.xml file location and actions what we need to do like clean, test or install etc. Location can be a local location or it can be a remote repository.
- We need to set up more options like Post-steps, Post-build actions as per your requirements.
These above steps will help to create maven-based item/job and you can start execution by simply click on Build Now to perform actions what we defined in item/job at the time of configuration.
After configuring the item/job settings, the Continuous server will download the code or project from Git repository if we provide git location. Then it will check the libraries in Maven home or download if not present. Then it will start the execution of item/job and perform the maven actions.
Let’s talk about how we can use Jenkins for orchestration of cloud platform. If we talk about AWS’s(amazon web services) cloud formation, AWS CloudFormation is a service that helps us to model and set up Amazon Web Services resources so that we can spend less time managing those resources and we can spend more time on focusing on your applications that run in AWS. Here are some resources what we can launch with help of cloud formation like
- EC2 Instances
- Security groups
- Authentication keys
- Database servers(RDS)
- Load Balancer
- Choose AMIs
- Custom VPC etc.
So we launch resources through cloud formation, we need to provide templates in JSON or YAML format and perform 2 to 3 steps to automate this thing. But we can automate the same thing through Jenkins by providing
- Location of template
- Parameter as per the template
- CLI IAM credentials to use resources
But make sure the credentials of IAM user, you are providing that user should have permission to access resources otherwise item/job will fail. After providing the above points, Continuous integration server will take care of everything
We can also use Jenkins to automate the orchestration in OCI(Oracle cloud infrastructure). Oracle Orchestration is a SaaS solution that lets us schedule and track workflows by executing scripts on hosts or calls Web service endpoints, all from a single location. We can schedule recurring maintenance tasks across on-premises and cloud infrastructure environments. By Oracle orchestration, we can launch the instance of classic compute by providing
- Network information like security groups and inbound, outbound ports
- Storage information like bootable/root volume & external volumes
- Machine image like Oracle Linux image
- CPUs / RAM etc.
Orchestration enables automation of tasks executed at hyper-scale by calling REST endpoints, scripts, or 3rd party automation framework.
Here are some DevOps stages in which we can use Jenkins with other tools:
- Continuous testing with Selenium web driver
- Build with Maven
- Continuous Management with Puppet
- Version control system with Git
- Continuous Monitoring with Nagios
- Continuous Deployment with Ansible