Convert to GitLab CI/CD Flow

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

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.

Prerequisites

To convert a Jenkinsfile, you must:

  • Have access to your Jenkins pipeline configuration.
  • Have at least the Developer role in the target GitLab project.
  • Meet the other prerequisites.

Use the flow

To convert your Jenkinsfile to GitLab CI/CD:

  1. On the left sidebar, select Search or go to and find your project. If you’ve turned on the new navigation, this field is on the top bar.
  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