Wechat official account: Operation and maintenance development story, author: Double Dong

What is Jenkins?

Jenkins is an open source continuous integration (CI) tool that provides a user-friendly interface. Originated in Hudson (Hudson is commercial), Jenkins is mainly used for continuous, automated building/testing of software projects and monitoring the execution of external tasks. Jenkins is written in the Java language and can run in popular servlet containers such as Tomcat or on its own. It is often used in combination with version management tools (SCM) and build tools. Common version control tools include SVN and GIT, and build tools include Maven, Ant, and Gradle.

  • Jenkins is a visual Web automation tool widely used for continuous integration

  • Good support for project construction in a variety of languages

  • Security compatible with ant, Maven, Gradle and other third-party build tools

  • It also integrates seamlessly with SVN and Git

  • Direct support for source hosting sites, such as Github and Bitbucket direct integration

  • With so many plugins and years of technology accumulation, most companies use Jenkins

Second, GitLab CI/CD

  • Gitlab-ci is a continuous integration system built after Gitlab 8.0. The central idea is that every push to Gitlab will trigger a script execution, and then the script content includes a series of customized content such as test, compilation and deployment

  • Script execution of Gitlab-CI requires customized installation of corresponding Gitlab-Runner for execution. After code push, Webhook detects code changes and triggers Gitlab-CI, which is assigned to each runner to run the corresponding script script. These scripts are used either for test projects or for deployment.

image.png

Third, comparison points

1. Branch configurability

Branch configurability

  • With Gitlab-CI, the newly created branch immediately uses the jobs defined in the CI pipeline without any step of configuration

  • Jenkina 2 basic GitLab multi-branch pipeline can be realized, compared to configuration of gitLab is more convenient

2. Execute the build periodically

Timing builds sometimes it helps to trigger jobs or entire pipelines based on time. For example, unconventional time, nightly timed builds

  • With Jenkins 2 it can be used immediately and can be defined in Cron syntax at the moment a job or pipe should be executed

  • Gitlab CI does not have this feature. However, there is a workaround: job or pipe implementations can be triggered using cronjobs on the same server or another via webAPI

3. Pull request support

Pull request support If the repository manager is well integrated with the CI/CD platform, you can see the current build status of the request. Using this feature, you can avoid merging code into a main branch that doesn’t work or doesn’t build properly

  • Jenkins is not further integrated with the source code management system, requiring administrators to write their own code or plug-in implementation

  • Gitlab is tightly integrated with its CI platform, making it easy to view the running and completion pipeline for each open or closed pull request

4. Rights management

Permission management from the repository manager is useful for large developers or organizations that do not want to set permissions for each user individually for each service. In most cases, the permissions are the same in both cases, so they should be configured in one location by default

  • Due to the deep integration of Gitlab and GitlabCI, permissions can be managed uniformly

  • Since Jenkins 2 does not have a built-in repository manager, it cannot directly merge permissions between the repository manager and the CI/CD platform

5. Repository interaction

  • Gitlab CI is a fixture of the Git repository manager Gitlab, thus providing good interaction between the CI/CD process and the repository functionality

  • Jenkins 2 is loosely coupled to the repository manager, making it very flexible when choosing a version control system. In addition, Jenkins 2 highlights support for plug-ins to further extend or improve existing functionality of the software

6. Plug-in management

  • Extending Jenkins’ native functionality is done through plug-ins. Plug-ins are expensive to maintain, protect, and upgrade

  • Gitlab is open, so anyone can contribute changes directly to the code base, and once merged, he will automatically test and maintain each change

Four,

GitlabCI
  • Lightweight, does not require complex installation means

  • Simple configuration, and gITlab can be directly adapted

  • The real-time build log is very clear and the UI interaction experience is good

  • With YAML configuration, anyone can easily use it

  • Without a unified management interface, it is impossible to manage all projects as a whole

  • Configuration dependence and code repository, coupling degree is not as low as Jenkins

  • Naturally distributed, GitLab Runner can be installed on any computer for easy testing and integration

Jenkins
  • The compilation service is decoupled from the code repository with low coupling

  • Plugins are rich and support many languages

  • A unified Web management interface is available

  • Plug-ins and their own installation are complicated

  • It is large and not very suitable for small teams

GitLabCI helps DevOps people, such as agile development, where development and operations are the same person, the easiest way to develop. JenkinsCI is suitable for multi-role teams with clear responsibilities, separation of configuration and code, and rich plug-ins. After using both, I think Gitlab-CI is easier to use. If gitlab-CI cannot meet the requirements, I can consider using Jenkins.

Public account: Operation and maintenance development story

Making:Github.com/orgs/sunsha…

Love life, love operation