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 code is public and can be invoked directly by your Bitbucket Pipeline.

  2. Reference the Code in Your Pipeline: Clone or fork the repository from Bitbucket:

    1
    git clone https://bitbucket.org/torodev/martini-upload-package.git
    
    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
    - pipe: torocloud/martini-upload-package-pipe:1.0.0
      variables:
        BASE_URL: "<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 extend your pipeline by using the GitHub Actions workflow available in our sample repository. This workflow facilitates building a Docker image that includes the specified version of Martini runtime, allowing you to manage runtime and package versions within a single, consistent deployment environment.

  2. 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