Skip to content

Bitbucket Pipelines

Bitbucket Pipelines provides a powerful CI/CD solution integrated with your Bitbucket repositories. This guide explains how to use Bitbucket Pipelines to automate the build and deployment of Martini packages, including how to configure and use the martini-upload-package-pipe.

Overview

Bitbucket Pipelines simplifies the process of building and deploying Martini packages by automating these tasks within your Bitbucket environment. The martini-upload-package-pipe helps you upload a Martini package directly to your Martini instance as part of your CI/CD process.

Steps to Configure Bitbucket Pipelines

  1. Access the Bitbucket Pipelines Code: The configuration code for Bitbucket Pipelines is available on Lonti's Bitbucket account. You can access it here. The pipe is public and can be integrated into your Bitbucket Pipeline.

  2. Reference the Code in Your Pipeline: Follow the instructions provided in the repository to integrate the code with your Bitbucket Pipelines configuration. This typically involves adding the following snippet to the script section of your bitbucket-pipelines.yml file:

    1
    2
    3
    4
    5
    6
    7
    8
    - pipe: torocloud/martini-upload-package-pipe:1.0.3
      variables:
        BASE_URL: "<string>"
        MARTINI_CLIENT_ID: "<string>"
        MARTINI_CLIENT_SECRET: "<string>"
        MARTINI_USER_NAME: "<string>"
        MARTINI_USER_PASSWORD: "<string>"
        PACKAGE_DIR: "<string>"
    

  3. Configure Your Pipeline: Customize the pipeline configuration to match your repository and deployment needs. This may include setting environment variables, secrets, or custom build commands. Ensure to configure the following required variables for the martini-upload-package-pipe:

Variable Usage
BASE_URL (*) Base URL of the Martini instance
MARTINI_USER_NAME (*) Name of a user on the Martini instance that should be used for uploading the package
MARTINI_USER_PASSWORD (*) The user's password
PACKAGE_DIR (*) Path to a directory that contains the package's files

(*) = required variable.

  1. Build a Docker Image:
    You can configure your Bitbucket Pipeline to build a Docker image that includes your Martini package. While GitHub Actions cannot be used directly in Bitbucket Pipelines, you can refer to this GitHub Actions workflow as a guide for setting up your Bitbucket Pipelines configuration. Adapt the workflow to your Bitbucket Pipelines by defining a docker build step that packages your Martini runtime and application into a container.

By incorporating this step, you can manage runtime and package versions within a single, consistent deployment environment, ensuring that your Martini application runs reliably across different deployments.

  1. Deploy Packages: With the pipeline configured, Bitbucket Pipelines will handle the building and deployment of your Martini packages according to the pipeline configuration.

Additional Resources