Skip to content

Azure Pipelines

Azure Pipelines is a cloud-based CI/CD service that helps you automate the build and deployment of Martini packages. This guide provides steps to configure Azure Pipelines for your Martini packages.

Overview

Azure Pipelines integrates seamlessly with your Azure DevOps environment to build, test, and deploy Martini packages. The code for this pipeline is available in the Azure Marketplace and can be easily integrated into your Azure Pipelines setup.

Deployment Models

The Sample Martini Repository showcases different models for deploying Martini packages:

  1. Build Docker:

    • This pipeline demonstrates how to build a Docker image containing a Martini package. With this approach, you can maintain control over both the version of the runtime and the packages within a single deployment.
  2. Deploy:

    • This model utilizes an Azure DevOps task plugin to prepare and upload the package to a Martini instance. This instance could be either local or remote, depending on the deployment configuration.

Each of these pipelines can be found in the Sample Martini Repository, and they serve as a reference for configuring your own pipeline workflows.

Steps to Configure Azure Pipelines

  1. Access the Azure Pipelines Custom Task:

    • The custom task for Azure Pipelines is available in the Azure Marketplace. Visit the Martini Upload Package Task directly to download and install it.
  2. Download and Install the Task:

    • Follow the instructions provided in the Azure Marketplace to download the custom task.
    • Install the downloaded task into your Azure DevOps organization.
  3. Explore Example Execution in the Sample Repository:

    • The custom task is demonstrated in the Sample Martini Repository. Use this example as a reference when configuring your own pipeline. This typically involves adding the following snippet to the steps section of your azure-pipelines.yml file:
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      - task: martiniUploadPackageTask@2
        inputs:
          PACKAGE_DIR: "<string>"
          PACKAGE_NAME_PATTERN: "<string>"
          ASYNC_UPLOAD: "<string>"
          SUCCESS_CHECK_TIMEOUT: "<integer>"
          SUCCESS_CHECK_DELAY: "<integer>"
          SUCCESS_CHECK_PACKAGE_NAME: "<string>"
        env:
          BASE_URL: "<string>"
          MARTINI_ACCESS_TOKEN: "<string>"
      
  4. Configure Your Pipeline: Open your Azure DevOps project and navigate to Pipelines. Customize the pipeline configuration to match your repository and deployment requirements. This may include setting up environment variables, secrets, or custom build steps. Ensure to configure the following required variables:

    Variable Required Usage
    BASE_URL Yes Base URL of the Martini instance
    MARTINI_ACCESS_TOKEN Yes The user's access token, obtainable via Martini or through the Lonti Console
    PACKAGE_DIR No Root directory containing packages (defaults to packages if not specified)
    PACKAGE_NAME_PATTERN No Regex pattern to filter which package directories to include. Defaults to .* (all directories).
    ASYNC_UPLOAD No If set to true, tolerates HTTP 504 as a success (used when uploads are handled asynchronously). Defaults to false.
    SUCCESS_CHECK_TIMEOUT No Number of polling attempts before timing out when checking package deployment status. Defaults to 6.
    SUCCESS_CHECK_DELAY No Number of seconds between polling attempts. Defaults to 30.
    SUCCESS_CHECK_PACKAGE_NAME No If set, only this specific package is polled after upload. If unset, all matched packages are polled.
  5. Deploy Packages:

    • With the pipeline configured, Azure Pipelines will handle the building and deployment of your Martini packages as specified in your pipeline configuration.

Additional Resources