Migrate from GitLab
This document provides an overview of how to migrate from GitLab to CircleCI.
The CircleCI configuration translator provides a way to convert your GitHub Actions or GitLab config into a CircleCI config.yml file. The configuration translator is currently in open preview. |
Tips provided by ImagineX Consulting
Sign up with GitLab
Follow the steps on the Sign Up and Try page to connect your GitLab account with CircleCI, then follow the steps in the following sections to migrate your CI/CD setup to CircleCI.
Build configuration
If you are using GitLab’s CI/CD, you will need to migrate your build configuration. On GitLab, the build configuration is defined in a file called .gitlab-ci.yml
in the root directory of your source code repository. If you use shell scripts to perform your build, you can reuse those scripts in CircleCI.
First, create a CircleCI build configuration file. In the root directory of your source code repository, create a folder named .circleci
and create a file in that folder named config.yml
. Next, follow the CircleCI documentation here to learn how to configure the .config.yml
file.
The GitLab and CircleCI configurations will be different. It may be helpful to have both GitLab and CircleCI reference documentation open side-by-side to help with the conversion of the build steps:
Configuration comparison
Using Docker? Authenticating Docker pulls from image registries is recommended when using the Docker execution environment. Authenticated pulls allow access to private Docker images, and may also grant higher rate limits, depending on your registry provider. For further information see Using Docker authenticated pulls. |
GitLab | CircleCI |
---|---|
Defining a job that executes a single build step | |
| |
Specify a Docker image to use for a job. | |
| |
Define a multi-stage build pipeline. Job1 and Job2 run concurrently. Once they are done, Job3 runs. Once Job3 is done, Job4 runs. | |
| |
Execute jobs on multiple platforms. GitLab uses tags to identify build runners. CircleCI provides all major OSes and Docker and must explicitly set in config. See our execution environments documentation for more information. | |
| |
Cache Dependencies. | |
| |
For larger and more complex build files, we recommend moving over the build steps in phases until you get comfortable with the CircleCI platform. We recommend this order:
-
Install dependencies, also see Cache dependencies
-
Run testing commands
-
Test results / test splitting / parallelism