GitLab CI/CD: Architecting, Deploying, and Optimizing Pipelines

Continuous Integration with GitLab

Import Git Repo

In this lesson, you’ll import your Node.js application’s source code—structured as the Solar-System project—into GitLab. The repository contains application logic, test cases, a Dockerfile, and several Kubernetes manifest files.

The image shows a GitLab repository page for a project named "Solar-System," displaying files, commit history, and project details. The sidebar includes options for managing, planning, and deploying the project.

Prerequisites

  • A GitLab account with at least Developer access in your target group.
  • The repository’s clone URL (ending in .git).
  • (Optional) A Personal Access Token if you’re importing a private repository.

Note

If your source repo is private, create a Personal Access Token with the read_repository scope and use it when prompted for credentials.

Step-by-Step Import Guide

  1. Copy the Git URL
    Grab the HTTPS or SSH clone URL of your source repository, ensuring it ends with .git.

  2. Start a New Project
    In GitLab’s top bar, click the + icon and select New project/repository.

  3. Select Import Method
    Choose Import project, then click Repo by URL.

  4. Fill in Import Details

    • Git repository URL: Paste the .git link.
    • Project name: Enter Solar-System.
    • Project slug: Adjust only if you want a custom URL path.
    • Group (Namespace): Pick your target group, e.g., demos.
    • Visibility: Set to Public, Internal, or Private.

The image shows a GitLab interface for importing a project, with fields for entering a Git repository URL, username, password, project name, and project description.

  1. Create the Project
    Click Create project. GitLab will clone and import your repository—this can take a few moments.

  2. Verify the Import
    Once completed, you’ll see your full project structure exactly as it was in the source:

The image shows a GitLab repository interface for a project named "Solar System," displaying a list of files and directories with their last commit messages and update times. The project was successfully imported, and the interface includes options for managing and configuring the project.

Your Solar-System repository now lives in the demos group on GitLab. Next, we’ll implement the CI/CD pipeline to run unit tests, measure code coverage, and deploy to Kubernetes.

Import Form Field Reference

FieldDescriptionExample
Git repository URLClone URL of the source repo (must end in .git)https://.../repo.git
Project nameDisplay name in GitLabSolar-System
Project slugURL-friendly identifiersolar-system
Namespace (Group)Target group or personal namespacedemos
Visibility LevelPublic, Internal, or PrivatePublic

Watch Video

Watch video content

Previous
Understanding XYZ Team DevOps Pipeline