Skip to content

GitLab Pipelines

GitLab Pipelines provide a powerful solution for continuous integration and deployment (CI/CD) within your GitLab environment. This guide explains how to use GitLab Pipelines to build and deploy Martini packages, and also how you can deploy your Martini packages bundled with a Docker image of the latest version of Martini Runtime.

Overview

GitLab Pipelines allow you to automate the build and deployment of Martini packages directly from your GitLab repository. The provided code is designed to be easily integrated with your GitLab CI/CD workflows.

Steps to Configure GitLab Pipelines

  1. Access the GitLab Pipelines Code:
  2. The configuration code for GitLab Pipelines is available on Lonti's GitLab account. You can access it here. The code is public and can be invoked directly by your GitLab Pipeline.

  3. Reference the Code in Your Pipeline:

  4. Clone or fork the repository from GitLab:
    1
    git clone git@gitlab.com:lonti/martini-build-pipeline.git
    
  5. Follow the instructions provided in the repository to integrate the code with your GitLab CI/CD configuration. This typically involves copying the .gitlab-ci.yml file into your own repository.

  6. Configure Your Pipeline:

  7. Adjust the pipeline configuration to fit your repository and deployment needs. This includes setting up any necessary environment variables, secrets, or custom build commands. Make sure to set up these 5 variables in your repository to ensure smooth deployment with your pipelines:
Variable Usage
MARTINI_USER_NAME Username of the Martini user on the instance
MARTINI_PASSWORD User's password
MARTINI_URL The URL of the Martini instance where artifacts will be uploaded
MR_VERSION The version of the runtime image which the Docker pulls
CI_REGISTRY_IMAGE The registry URL where the Docker image will be pushed after building
  1. Deploy Packages:
  2. Once configured, GitLab Pipelines will automatically handle the build and deployment of your Martini packages according to the specified pipeline configuration.

Additional steps: - If you want to leverage the Docker CI/CD Pipeline, make sure to configure and add your Dockerfile in your Gitlab repository. Here's a sample Dockerfile to use with Martini Runtime:

1
2
3
4
5
6
ARG MR_VERSION
FROM toroio/martini-runtime:${MR_VERSION}

COPY packages /data/packages
WORKDIR /data
ENTRYPOINT ["sh", "/data/bin/toro-martini"]

Additional Resources