Skip to content

Convert to GitLab CI/CD flow

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

Version history

  • Introduced as a beta in GitLab 18.3 with a flag named duo_workflow_in_ci. Disabled by default. The duo_workflow flag must also be enabled.

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

Before you can convert a Jenkinsfile, you must have:

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.
  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