Migrate a GitLab group to Harness Code Repository by following detailed steps for importing repositories and setting up CI pipelines. Enhance DevOps with seamless integration and advanced CI features.
Harness Code Repository provides developers with a familiar Git experience, packed with essential features. Harness Continuous Integration provides advanced intelligence features and build infrastructure, which can significantly reduce build and test times.
Combined with the unparalleled governance and security features of the Harness platform, Harness provides a compelling alternative to GitLab.
In this post, we will see how to import a GitLab group into the Harness Code Repository, then generate and execute a Harness Continuous Integration pipeline.
Here is a full walk-through of the steps covered.
In your GitLab profile, navigate to Access Tokens, then select Add new token. Give the token a name, choose the read_api scope, then select Create personal access token. Store the access token in a safe place.
In the Harness Code Repository, choose Import Repositories from the New Repository drop-down menu. Select GitLab from the Git Provider menu, enter your GitLab access token, then select Next step. Enter your group name in the Group field, then select Import Repositories.
All repositories in your GitLab group will be imported into your Harness project.
If you need to keep working in your GitLab repository, you can mirror changes between both repositories during your transition to Harness.
Navigate to the Get Started workflow in your Harness CI project. You can choose from multiple infrastructure types, this guide will use Harness Cloud infrastructure. In the Select your Repository view, choose your desired repository from the list, then select Configure Pipeline.
By choosing Generate my Pipeline configuration, Harness CI can inspect the code in your repository and automatically generate your pipeline configuration. You can also choose Create empty Pipeline configuration.
Unlike other CI providers, Harness CI offers the flexibility of storing the pipeline YAML file in your repository, or within the Harness platform.
In the Configure Pipeline view, expand See Advanced Options, here you can select Store in Git. You can also customize the name and location of the pipeline YAML file.
Select Create Pipeline to continue.
Examine your pipeline configuration in the YAML editor view, or in the visual pipeline editor. Select the Run icon in the top-right corner, then select Run Pipeline and observe your pipeline execution.
Harness Cache Intelligence will be enabled if your language is supported, and you chose Generate my Pipeline configuration when creating the pipeline. Cache Intelligence takes the “guesswork” out of caching your build dependencies, ensuring dependencies are only downloaded and rebuilt when necessary.
In just a few steps, we were able to import our GitLab group into Harness and execute a pipeline!