Introduction

This guide provides an overview of custom task extensions within Azure DevOps, focusing on their application in CloudHub deployments. Azure DevOps offers a comprehensive DevOps solution for MuleSoft, allowing the creation of custom extensions to streamline repetitive tasks and enhance collaboration.

Understanding DevOps

DevOps is a set of practices aimed at reducing the time from committing a change to deploying it into production while maintaining high quality. It bridges the gap between development, operations, and quality assurance teams.

Azure DevOps Overview

Azure DevOps, a service from Microsoft, offers tools for team collaboration on software development projects. It facilitates planning, code development, and application deployment, embracing Agile methodologies and supporting a variety of programming languages.

Azure DevOps supports a set of processes that bring developers, project managers, and contributors together to complete software development. It also helps organizations to create and improve products at a faster pace than they can with traditional software development approaches.

Key Services in Azure DevOps:

  1. Azure Repos: Hosts Git repositories or Team Foundation Version Control (TFVC)  for source control.
  2. Azure Pipelines: Supports continuous integration and delivery with build and release services.
  3. Azure Boards: Provides a suite of Agile tools to support planning and tracking work, code defects, and issues using Kanban and Scrum methods.
  4. Azure Test Plans: Offers tools for app testing, including manual, exploratory, and continuous testing.
  5. Azure Artifacts: Facilitates packages such as Maven, npm, NuGet, and more to share from both public and private sources, integrating with pipelines.

Azure Pipelines

Azure Pipelines automatically builds and tests code projects to make them available to others. It works with just about any language or project type. Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to test and build your code and ship it to any target.

  • Continuous Integration (CI): Automates merging and testing code to detect bugs early. It is the practice used by development teams to automate merging and testing code. Implementing CI helps to catch bugs early in the development cycle, which makes them less expensive to fix. Automated tests are executed as part of the CI process to ensure quality. Artifacts are produced from CI systems and fed to release processes to drive frequent deployments. The Build service in Azure DevOps Server helps you set up and manage CI for your applications.
  • Continuous Delivery (CD): Automates code deployment to multiple environments, enhancing quality. It is a process by which code is built, tested, and deployed to one or more test and production environments. Deploying and testing in multiple environments increases quality. CI systems produce deployable artifacts, including infrastructure and apps. Automated release processes consume these artifacts to release new versions and fixes to existing systems. Monitoring and alerting systems run continually to drive visibility into the entire CD process.
  • Continuous Testing (CT): Involves automated build-deploy-test workflows, with a choice of technologies and frameworks, that test your changes continuously in a fast, scalable, and efficient manner.

Pipeline Tasks

Pipeline tasks are fundamental to automation in Azure DevOps, serving as packaged scripts or procedures with specific inputs. A task is simply a packaged script or procedure that has been abstracted with a set of inputs.

Custom Pipeline Tasks

Azure DevOps allows the creation of custom pipeline tasks for specialized build and deployment needs, enhancing the flexibility and adaptability of the DevOps process. Also, Azure provides some built-in tasks to enable fundamental build and deployment scenarios.

Custom Pipeline Task Extensions

Extensions are add-ons we can use to customize and extend our DevOps experience with Azure DevOps. Extensions are written with standard technologies – HTML, JavaScript, CSS – and can be developed using any preferred development tools.

Custom task extensions in Azure DevOps, developed using standard web technologies, allow for the customization of the DevOps experience. These extensions interact with Azure DevOps services via a RESTful API Library and can be published on the Visual Studio Marketplace.

Extensions can be kept private for individuals and teams or shared with the millions of developers currently using Azure DevOps.

CloudHub Deployment Pipeline Extension

This extension is designed specifically for deploying Mule build artifacts to Anypoint CloudHub. It streamlines the deployment process, ensuring efficient and error-free operations.

    Custom Pipeline Task Extension for CloudHub deployment

    Using Azure DevOps, we can create custom task extensions for Mule build and release pipelines.

    This CloudHub Deployment Pipeline Extension serves as an individual task that locates a Mule build artifact and deploys it to a specific Anypoint CloudHub business organization and environment (with settings) specified by the pipeline running the extension.

    Advantages of Custom Pipeline Task Extensions

    • Enhanced Reusability: Facilitates the reuse of pipeline tasks across different teams.
    • Error Reduction: Minimizes errors through mandatory input fields for successful pipeline creation.
    • Standardization: Helps standardize build processes across the organization.

    Considerations

    This is one one the ways to customize Cloudhub deployment using Azure DevOps but it has some limitations that need to be evaluated before considering this as an option:

    • Technical Knowledge Required: Familiarity with Python, Node.js, CSS, and JavaScript is necessary.
    • API Dependency: Reliant on Anypoint CloudHub API, requiring updates in case of API changes.
    • Support: The provided code is for reference and is not officially supported by MuleSoft.

    Use Case

    Custom pipeline task extensions offer a more user-friendly interface compared to Maven tasks in Azure Pipelines. They allow for a unified approach in pipeline creation and can accommodate environment-specific modifications, such as secure file injection, enhancing security and control over the deployment process.

    Typically when we use Maven tasks in Azure Pipelines, the interface is not as user-friendly and it requires a lot of expertise from the person who is building the release pipelines.

    Using Azure Pipeline Task extensions we can overcome all the shortcomings and create a unified interface for the users that should follow while building the pipelines.

    Also, the Python script could be modified to inject environment-specific files (Certs, conf files), especially in the production environment so developers don’t have access to the highly secure files.

    Steps to create a custom task extension in Azure DevOps

    Please find below steps to create and publish custom task extensions using Azure DevOps

    Follow the steps to Create a custom task using Azure DevOps

    Once you publish the task and share it with your organization, the task will be available under your organization’s extensions.

    Once the task is available in your Organization’s extensions, you can select the same while creating the pipeline.

    Loading

    Subscribe To Our Newsletter

    Subscribe To Our Newsletter

    Join our mailing list to receive the latest news and updates from our team.

    You have Successfully Subscribed!