DevOps is basically a culture. You can say software engineering culture. Aim or objective of DevOps is unifying software development (Dev) and software operation (Ops). DevOps is a broad area and it involves many tools at different stages/phases. There are many tools available to implement DevOps.
Continuous Delivery is an approach where teams release quality products frequently and predictably from source code repository to production in an automated fashion.
Some organizations release products manually by handing them off from one team to the next, which is illustrated in the diagram below. Typically, developers are at the left end of this spectrum and operations personnel are at the receiving end. This creates delays at every hand-off that leads to frustrated teams and dissatisfied customers. The product eventually goes live through a tedious and error-prone process that delays revenue generation.
Now, check out the continuous delivery pipeline below. It illustrates how developers write code on their laptops and commit changes to a source code repository and finally it process to production.
Some of the most common terminologies involved in building efficient CI/CD pipelines across various SDLC projects:
Let us understand what happens in each of the above stages:
Source Control Management is also referred to as Version Control Software (VCS) and Revision Control System (RCS). While there are several source control management tools available in the industry, Git is the most popular and widely used one as of date, while there are others like SVN, TFS, Mercurial, CVS as well.
Here, are the key elements which you need to perfom the entire CI process:
Development without CI | Development with CI |
Lots of Bugs | Fewer bugs |
Infrequent commits | Regular commits |
Infrequent and slow releases | Regular working releases |
Difficult integration | Easy and Effective Integration |
Testing happens late | Continuous Integration testing happens early and often |
Issue raised are harder to fix | Find and fix problems faster and more efficiently. |
Poor project visibility | Better project visibility |
The software was built and tested as soon as a developer committed code. If any error is detected, the respective developer can quickly fix the defect.
Jenkins is an open-source, extensible automation server for implementing continuous integration and continuous delivery. You can integrate Salesforce DX with Jenkins framework to automate Salesforce deployment.
Jenkins is a widely used application around the world that has around 300k installations and growing day by day. By using Jenkins, software companies can accelerate their software development process, as Jenkins can automate build and test at a rapid rate.
In simple words, Jenkins Pipeline is a combination of plugins that support the integration and implementation of continuous delivery pipelines using Jenkins.
The pipeline as Code describes a set of features that allow Jenkins users to define pipelined job processes with code, stored and versioned in a source repository. … To use Pipeline as Code, projects must contain a file named Jenkinsfile in the repository root, which contains a “Pipeline script.”
The table below shows the comparison between “Before and After Jenkins”.
Before Jenkins | After Jenkins |
---|---|
The entire source code was built and then tested. Locating and fixing bugs in the event of build and test failure was difficult and time-consuming, which in turn slows the software delivery process. | Every commit made in the source code is built and tested. So, instead of checking the entire source code developers only need to focus on a particular commit. This leads to frequent new software releases. |
Developers have to wait for test results | Developers know the test result of every commit made in the source code on the run. |
The whole process is manual | You only need to commit changes to the source code and Jenkins will automate the rest of the process for you. |
1. Project / Job
A Project or a Job is a collection of configurable instructions used for building developed source code, testing, collecting artifacts, sending notifications in emails, deploying in required environments, and much more.
2. Pipelines
A Jenkins pipeline is set of instructions and build steps configured in Jenkins to run all the processes in multiple environments in various steps.
3. Build Queue and Build Executor Status
4. Plugins
More than 1500 community-contributed plugins in Jenkins support building software varieties, automate tests, and deploy projects for production releases.
5. Master – Agent
Executes in remote parallel machines for shorter build and test running time using additional resources in the cloud.
2. Limitless integrations. Jenkins can integrate with almost any external program used for developing applications. It allows you to use Docker and Kubernetes out-of-the-box.
3. A rich library of plugins is available with Jenkins: Git, Gradle, Subversion, Slack, Jira, Redmine, Selenium, Pipeline, you name it.
4. Active community. The Jenkins community provides a guided tour to introduce the basics and advanced tutorials for more sophisticated use of the tool. They also hold an annual conference DevOps World | Jenkins World.
2. Poor UI. Its interface seems a bit outdated as it doesn’t follow modern design principles. The absence of whitespaces makes the views look crowded and confusing. A lot of the progress features and icons are super pixelated and don’t refresh automatically when jobs finish.
For more information about Jenkins , Check out https://www.jenkins.io/
It is a version control system. It helps and allows engineers to track changes in the file. Key features of Git include moving or adding files, ignoring certain files, branches, checking statues of the changes, finding version that introduced a bug using Binary Search.
Version Control is the management of changes to documents, computer programs, large websites and other collection of information.
There are two types of VCS:
A centralized version control system (CVCS) uses a central server to store all files and enables team collaboration. It works on a single repository to which users can directly access a central server.
Please refer to the diagram below to get a better idea of CVCS:
These systems do not necessarily rely on a central server to store all the versions of a project file. In Distributed VCS, every contributor has a local copy or “clone” of the main repository. Here everyone maintains a local repository of their own which contains all the files and metadata present in the main repository.
You will understand it better by referring to the diagram below:
As discussed earlier, Git is a source control manager. That is where you keep your source code for tracking all the code changes that happen over time and to baseline the versions when they are ready for release.
Jenkins, on the other hand, is a continuous integration solution. It is devised to automate most of the tasks that a developer has to do while developing a new application (code quality checks, building, archiving of build artifacts, integration testing, deployment to various environments, etc.) Without a CI solution, a developer has to spend much time doing these repetitive non-productive tasks.
First Setup is download Jenkins and installed it on your machine or AWS server where you want to use this.
Step 1.1) Download Jenkins from here.
Step 1.2) Go to download location from local computer and unzip the downloaded package.
Double-click on unzipped jenkins.msi. Then Start installation.
Step 1.3) After completing the Jenkins installation process, a browser tab will pop-up asking for the initial Administrator password. To access Jenkins, you need to go to browse the following path in your web browser. The initial Administrator password should be found under the Jenkins installation path.
Customize Jenkins
You can also customize your Jenkins environment by below-given steps:
Step 1.4) Click on the “Install suggested plugins button” so Jenkins will retrieve and install the essential plugins.
Note: You can choose the Option “Select Plugins to Install” and select the plugins you want to install
Step 1.5) After all suggested plugins were installed, the “Create First Admin User” panel will
show up. Fill all the fields with desired account details and hit the “Save and Finish” button.
Congratulations! We have successfully installed a new Jenkins Server. Hit the “Start using
Jenkins” button.
Jenkins comes with a pretty basic setup, so you will need to install the required plugins to enable respective third-party application support.
GitHub is a web-based repository of code which plays a major role in DevOps. It provides a
common platform for multiple developers working on the same code/project to upload and
retrieve updated code, thereby facilitating continuous integration.
You need not install a GitHub plugin if you have already installed the Git plugin in response to
the prompt during the Jenkins’ installation setup
Following is a step by step process on how to Install Git plugin in Jenkins:
Step 2.1: Click on the Manage Jenkins button on your Jenkins dashboard:
Step 2.2: Click on Manage Plugins:
Step 2.3: In the Plugins Page
Now you need decide which tool you want to use for Salesforce Deployment. You can use ANT tool or you can use Salesforce DX for Salesforce Deployment. Here is link to Download the Salesforce CLI.
Create a Self-Signed SSL Certificate and Private Key to setup the JWT Flow.
Step 4.1) Download the Open SSL
Download the Open SSL from your here.
Step 4.2) Create a private key and self signed certificate
Execute below command to create the a private key and self signed certificate.
set OPENSSL_CONF=C:\openssl\share\openssl.cnf
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
Now it time to setup the connected app in Salesforce for Jenkine Deployment.
Step 5.1) Created Connected App
http://localhost:1717/OauthRedirect
Step 5.2) Validate Authorize an Org Using the JWT-Based Flow
Execute below command to validate the authorization for an org using JWT-based flow.
sfdx force:auth:jwt:grant --clientid {ADD_YOUR_CLIENT_ID} --jwtkeyfile server.key --username amit.salesforce21@gmail.com --instanceurl https://login.salesforce.com --setdefaultdevhubusername
Once Authentication is successful then you are ready for final configuration.
The names for these environment variables are just suggestions. You can use any name as long as you specify it in the Jenkinsfile.
Copado is a latest tool used on Saas platform recently came into Salesforce market with easy deployment features.
Copado | Jenkins |
Platforms Supported: Saas & Web | Platforms Supported: Windows, Mac & Linux |
DevOps teams in need of a Value Stream platform for Salesforce | Software development teams searching for a solution to improve the quality of their projects |
Online Support available | No Support |
No API offers | Offers API |
Pricing : 10K USD/Year | Pricing : No |
Started in 2013 | Started in 2004 |