GitLab
Introduction
GitLab is a web-based DevOps lifecycle tool that provides a Git repository manager, CI/CD pipeline features, and more, enabling teams to collaborate on code, track issues, and deploy applications.
What is GitLab?
GitLab is an open-source platform that offers a complete DevOps toolchain, allowing developers to manage repositories, run automated tests, and deploy code. It supports version control, continuous integration, and continuous deployment, facilitating development workflows.
Autom Mate Integration with GitLab
Integrating GitLab with Autom Mate enhances your automation capabilities by allowing you to manage projects and pipelines directly within your workflows. This integration enables you to automate tasks such as creating and managing pipelines, retrieving project details, searching for projects, thereby improving efficiency and reducing manual effort.
Credentials
To connect Autom Mate with your GitLab account, user needs yo generate a Personal Access Token in GitLab. To do that please follow below steps.
Log in to your GitLab account.
Navigate to your profile settings.
Select "Access Tokens" and create a new token with the necessary scopes.
Credentials Creation Steps
To use GitLab actions in Autom Mate, you need to create credentials. Follow these steps:
Navigate to the Vault page under the Management section in the left side menu.
Ensure you are on the Application Credentials tab on the left side.
Search for GitLab using the filter or manually.
Alternatively, click on the "New App Credentials" button at the top left side of the window to create new credentials.
Provide Credentials
Connector Name: Unique name for the connector.
Authentication Type: Choose the method you want to connect.
URL: URL of the GitLab instance.
Username: Username of the user which will do the API Calls.
API Token: The API Token of the user provided above.
After filling the fields, press on "Test Connect". This option will try to send an API call to "{GitLab_url}/user/{username}/api/json" to see if the credentials are working. If you get a successful response, you can press the "Connect & Create" button to save the credential.
How to Use Actions
Autom Mate provides several actions to interact with GitLab. Below are the available actions and their details:
Create Pipeline
Initiates a new pipeline for a specified project and branch or tag. Triggers a new pipeline in a GitLab project, which automates tasks such as building, testing, and deploying code. This is useful for CI/CD workflows, ensuring code changes are validated and deployed.
Use this action when you need to automate deployments after a code push or merge.
Ideal for continuous integration, ensuring all commits go through the same validation process.
Works with specific branches or tags, allowing for precise control over the pipeline execution.
Usage Instructions
Project ID
The unique identifier of the project where the pipeline will be created.
Ref
The branch or tag to run the pipeline on.
Variables (Optional)
A list of key-value pairs to set CI/CD variables for the pipeline.
Expected Output: Returns details of the created pipeline, including its ID, status, and web URL.
Delete Pipeline
Removes a specified pipeline from a project. This is useful when a pipeline is no longer needed or if a faulty pipeline needs to be cleared from the system.
Use this action to clean up old pipelines and keep the project history organized.
Helps reset incorrect builds by deleting problematic pipelines and rerunning new ones.
Usage Instructions
Project ID
The unique identifier of the project containing the pipeline.
Pipeline ID
The unique identifier of the pipeline to be deleted.
Expected Output: Confirms the deletion of the pipeline.
Get Pipeline
Retrieves details of a specific pipeline within a project. Retrieves details of a specific pipeline, including its status, execution time, and associated commits.
Use this action to monitor pipeline progress within Autom Mate.
Helps in troubleshooting failed pipelines by fetching details such as logs and errors.
Can be combined with notifications to alert teams when a pipeline completes or fails.
Usage Instructions
Project ID
The unique identifier of the project containing the pipeline.
Pipeline ID
The unique identifier of the pipeline to retrieve.
Expected Output: Provides detailed information about the pipeline, including its status, stages, and associated commit.
Get Project
Fetches details of a specific project. Fetches detailed information about a GitLab project, such as repository details, visibility settings, and members.
Use this action to retrieve project metadata dynamically within workflows.
Helps automate project-related reporting and documentation.
Useful when working with multiple projects and needing quick access to project details.
Usage Instructions
Project ID
The Project ID is required to retrieve project details. When selecting or entering a Project ID, the Data Manager will open automatically, displaying available fields within the project.
Expected Output: Returns comprehensive information about the project, such as its name, description, visibility, and repository details.
The Project ID is required to retrieve project details. Once you select or enter a Project ID, the Data Manager will automatically open, displaying the available fields within the project.
List Project Pipelines
Lists all pipelines associated with a specific project. Returns a list of all pipelines for a given GitLab project, including their statuses, IDs, and creation timestamps.
Use this action to get an overview of recent pipeline runs.
Helps identify patterns in failures or delays in the CI/CD process.
Useful for automating reports about pipeline success rates.
Usage Instructions
The Project ID field is required to retrieve pipelines.
You can either select a Project ID from a dropdown (maximum 100 projects will be listed) or enter it manually.
When selecting a Project ID, the Data Manager will open automatically, displaying all available fields within GitLab related to pipelines.
You can specify additional parameters such as Name, Order By, Ref, Scope, SHA, Sort, Source, Status, Updated After, etc.
Expected Output: Provides a list of pipelines with details like ID, status, ref, and creation date.
List Projects
Retrieves a list of all accessible projects. Allows users to fetch projects, applying filters to refine the results as needed.
Use this action to retrieve a filtered list of projects. When configuring this action, the Data Manager will open automatically, displaying all available fields within the projects, such as archived status, visibility, ID range, and more. These fields help refine the query and customize the output.
Select a project from a list when configuring new processes.
Useful for managing multiple GitLab repositories efficiently.
The Data Manager will automatically open, displaying the available fields within the project.
Expected Output: Returns a list of projects with basic information like ID, name, and description.
Search Projects by Name
Searches for projects that match a specified name or pattern. Searches for GitLab projects based on a given name or keyword.
Use this action to find projects quickly without manually browsing through GitLab.
Helps when managing large-scale projects with multiple repositories.
Useful for automating workflows that need to operate on specific projects dynamically.
Usage Instructions
Project Name
The name or partial name of the project to search for.
Expected Output: Provides a list of projects that match the search criteria, including their IDs and descriptions.
Last updated
Was this helpful?