GoCD vs Jenkins: Detailed Comparison
July 20, 2022
Implementing CI/CD strategies helps deliver software updates to users in an automated way by avoiding human interaction. This minimizes the errors made by humans when deploying to the servers and reduces the applications’ downtime for faster product launches.
The key difference between CI & CD:
- Continuous Integration integrates feature branch commits to the main branch by continuously running and merging tests.
- Continuous Deployment deploys the combined code from the main branch to the development or production environment.
CI/CD is provided by companies like GitLab with Gitlab CI, Github with Github actions, Travis CI, Circle CI, Jenkins, and GoCD. This guide is intended to define and draw out core differences between GoCD and Jenkins that will help you pick the most relevant one for your projects.
What is GoCD?
It is an open-source CI/CD server and a piece of software that can be deployed into virtual machines, Docker, Kubernetes, and cloud providers like Amazon Web Services(AWS), Google Cloud, and Microsoft Azure. GoCD is developed using Java and Ruby.
It works in a master-slave architecture, i.e. there will be a single machine that controls the other agents.
In the above diagram, the GoCD Server acts as a master and delegates the jobs to the agents.
Core Concepts of GoCD
GoCD has some core concepts, hence, understanding these concepts helps to build and accelerate CI/CD pipelines effectively.
Let’s try to understand the core concepts of GoCD with an example.
- Task: It is the smallest unit of work that can be done. It could be running a shell script, using a build tool like Maven/Gradle, or running unit tests using a command
- Job: A group of tasks is called a job. Suppose we have a job called static code analysis (which means checking the complexity of methods and styling of the code using tools like SonarQube or Checkstyle).
In that case, it can be converted into multiple tasks like
- Task 1: Check out the code from Git
- Task 2: Run the static code analysis tool (SAT)
- Task 3: Check if the result from SAT tool is satisfactory
- Task 4: Clean up the artifacts created by the SAT
A job is said to be failed if any of the tasks in the job is failed.
- Stage: A stage is a group of jobs. As discussed above, in the job of static code analysis, there can be other jobs like running end-to-end tests consisting of multiple other tasks. The jobs in the stage could be independent of each other.
- Pipeline: A group of stages forms a pipeline. The pipeline can be dependent on the previous job’s completion status. This means, as shown in the diagram below if the “Code Analysis and Unit Testing Stage” fails, the “Deployment stage” won’t start.
How to trigger the CI/CD pipeline?
The CI/CD pipelines get triggered or started based on events that tell when the jobs, tasks, stages, or pipelines start.
A trigger event will fire the execution of a pipeline. Types of the trigger are:
- Git commit trigger: If we merge changes of a feature branch to a master branch, it can be considered as an event. This event can trigger the CI/CD pipeline.
- Timer trigger: If we configure a job/pipeline like running tests at a specified interval of time like every day morning at 8:00 AM UTC, the tests need to be run; this can be achieved using timer trigger
Value Stream Map
Value Stream Map is a GoCD feature which helps in visualizing the entire CI/CD pipeline. This is basically a dependency graph that visualizes the flow from left to right.
The above image is what a Value Stream Map looks like in GoCD which helps you to understand the upstream and downstream dependencies.
Upstream dependencies are the jobs that are required by the next job to be run to completion.
In the above image, the upstream dependencies are the “Services”. The “Services” stage must be successfully completed before running the next job called “Build”.
Downstream dependencies are the jobs that can be run independently without dependency on the previous job.
Image with Environment 1
Image with only Environment 2
In the above image with only Environment 2, there is no job called “Environment-1”, what this means is the job “Environment-2”, can be run with no dependency on “Environment-1”.
Integrate BrowserStack Automate with GoCD
What is Jenkins?
Jenkins is an open-source CI/CD tool that can be used to automate tasks for building, testing, and deploying the software. It is developed entirely with Java. Jenkins also follows master-slave architecture, where there is a master node which has assigns the job to slave nodes.
Core Concepts of Jenkins
Continous testing with Jenkins CI has three major constructs that help you build a pipeline. A pipeline is a definition where the user can specify the required job to test, develop and deploy.
- Step: It is the smallest unit of the work that can be done. It can be as simple as Checking out the code from Source Code Management(SCM) like Git.
- Stage: A group of steps forms a stage. Consider, if unit tests need to be run on the project, it first needs to check out the code and then run the tests using appropriate tools.
- In the below image, if we consider the stage to be “Run Unit tests”, it has two steps:
- Check out code from Git
- Run unit tests
- Pipeline: A group of stages forms a pipeline, which helps in continuous delivery (CD). Consider if a Java app needs to be deployed in a production environment, then the following stages need to be there:
- Stage 1 – Run tests
- Stage 2 – Build a JAR file and push to repository
- Stage 3 – Deployment
Triggering Jenkins Pipeline
There are multiple ways a Jenkins pipeline can be triggered. Some of them are:
- Git commit trigger: Whenever any commit is done to the main branch, trigger a Jenkins pipeline
- Scheduled pipeline: A Jenkins pipeline can be configured to run periodically at a set time or set interval
- Remote trigger: An external API/webhook can be used to trigger a Jenkins pipeline
Must-Read: Continuous Integration Tutorial with Jenkins
Viewing the Jenkins pipeline
Pipelines built can be viewed as stages or graphs in Jenkins UI. This helps understand how the stages are sequences in a given pipeline and makes it easier for users to understand the pipeline’s flow. Jenkins currently has two UI’s. One is a classic UI that was initially there from inception and another is called Blue Ocean which provides a cleaner interface for viewing pipelines.
Jenkins Classic UI
Jenkins Blue Ocean UI
Core Differences between GoCD and Jenkins
On a high level, GoCD and Jenkins are both CI/CD tools that help your job gets done. A comparison of Jenkins vs GoCD helps you understand their core differences
Comparison Parameter | GoCD | Jenkins |
Continous Integration | Built for Continuous integration (CI). Anything beyond that requires plugins | Built specifically with continuous delivery (CD philosophy) But has a sophisticated feature for continuous integration. |
Continuous Delivery | Only one way to implement the fundamental CD concept | Can implement the CD concept by installing a variety of plugins |
Language Support | Ruby and JavaScript via plugins | Partially supports Ruby and JavaScript |
Plugins Support | Only few plugins are available | Extensive plugins are available for many use cases |
Community | Community available is small | Large community support |
How to Start | GoCD’s getting started tutorial is a good place | Jenkins provides a wizard to guide you through plugin installation and setup your first build |
User Interface | Good but needs improvement | Easiest interface and user-friendly |
Key Takeaways
When comparing GoCD vs Jenkins, Jenkins being an open-source project from inception i.e. in 2011 during a phase where a lot of software companies are moving towards DevOps approach, it is adopted by many organizations, and a lot of projects use it.
When it comes to automation, Jenkins provides plugins that help run test suites, gather dashboard results, and provide details on failures.
- Runs Automated Test Suites: Jenkins provides plugins for various test frameworks like Selenium, Cucumber, Appium, Robot framework, etc. These can be integrated into CI pipelines to run automated tests for every build.
- Provides Trends: Jenkins keeps track of results and displays them as a trend graph. This offers a better view of how the tests have fared in the past.
- Display details on Test Failures: Test results are tabulated, and failures are logged with the test results.
Coming to GoCD, even though it has been available since 2007, it has been open-sourced only in 2014. It has been a reason for its low adoption, smaller community, and lesser number of plugins being available.
When we compare Jenkins vs GoCD, Jenkins is more battle-tested, used by companies like Facebook, Oracle, Netflix, Lyft, etc. The above comparison of GoCD vs Jenkins should give you a good idea of its differences and helps you to choose a CI/CD tool for your work.
No matter what CI/CD tools you choose, you can Empower your CI/CD pipeline with automation testing on BrowserStack’s Cloud Selenium Grid of 3000+ real browsers and devices and leverage integrations with the most powerful CI/CD tools available today.