The GitLab Docs website is now available in Japanese!

Convert to GitLab CI/CD Flow

  • Tier: Premium, Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed

The availability of this feature is controlled by a feature flag. For more information, see the history.

The Convert to GitLab CI/CD Flow helps you migrate your Jenkins pipelines to GitLab CI/CD. This flow:

  • Analyzes your existing Jenkins pipeline configuration.
  • Converts Jenkins pipeline syntax to GitLab CI/CD YAML.
  • Suggests best practices for GitLab CI/CD implementation.
  • Creates a merge request with the converted pipeline configuration.
  • Provides guidance on migrating Jenkins plugins to GitLab features.

This flow is available in the GitLab UI only.

![note] The Convert to GitLab CI/CD Flow creates merge requests by using a service account. Organizations with SOC 2, SOX, ISO 27001, or FedRAMP requirements should ensure appropriate peer review policies are in place. For more information, see compliance considerations for merge requests.

Prerequisites

To convert a Jenkinsfile, you must:

Use the flow

To convert your Jenkinsfile to GitLab CI/CD:

  1. On the top bar, select Search or go to and find your project.
  2. Open your Jenkinsfile.
  3. Above the file, select Convert to GitLab CI/CD.
  4. Monitor progress by selecting Automate > Sessions.
  5. When the pipeline has successfully executed, on the left sidebar, select Code > Merge requests. A merge request with the title Duo Workflow: Convert to GitLab CI is displayed.
  6. Review the merge request and make changes as needed.

Conversion process

The process converts:

  • Pipeline stages and steps.
  • Environment variables.
  • Build triggers and parameters.
  • Artifacts and dependencies.
  • Parallel execution.
  • Conditional logic.
  • Post-build actions.

Example

Jenkinsfile input:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'npm install'
                sh 'npm build'
            }
        }
        stage('Test') {
            steps {
                sh 'npm test'
            }
        }
        stage('Deploy') {
            when { branch 'main' }
            steps {
                sh './deploy.sh'
            }
        }
    }
}

GitLab output:

stages:
  - build
  - test
  - deploy

build:
  stage: build
  script:
    - npm install
    - npm build
  artifacts:
    paths:
      - node_modules/
      - dist/

test:
  stage: test
  script:
    - npm test

deploy:
  stage: deploy
  script:
    - ./deploy.sh
  only:
    - main