Accelerate Azure DevOps or TFS with JFrog Artifactory and Conan

For some C/C++ developers, working within the structure of continuous integration can be an awkward transition. Running a CI server and the supporting tools to resolve dependencies, share packages, and manage binaries may be unfamiliar, and getting them to work together well can be challenging.

C/C++ Continuous Integration Challenges

Microsoft’s Azure DevOps (formerly known as VSTS) or TFS can be attractive to these developers, providing an environment for coding and building applications that they’re already familiar with. But to integrate this CI server with those tools that help manage builds, may require using shell commands, a manual and complex method that’s prone to mistakes.

That’s why we made the JFrog Artifactory Extension for Azure DevOps and TFS available in the Azure marketplace, to provide easy integration of the Artifactory binary repository manager with those CI development platforms. And in the latest version, the extension now supports Conan tasks that can make it easier to run Conan builds.

Conan Promotes C/C++ in Azure DevOps

Conan is an open source, decentralized and multi-platform package manager for C/C++ developers to create and share native binaries. It can be used with Artifactory as a Conan Package Manager to resolve dependencies and share packages within your organization.

The support for Conan now in the JFrog Artifactory Extension helps you perform the following tasks in Azure DevOps or TFS:

  • Run Conan commands
  • Resolve Conan dependencies from remote Artifactory servers
  • Push Conan packages to Artifactory
  • Publish BuildInfo metadata
  • Import a Conan configuration

This tutorial shows how to add Conan tasks to your Build or Release pipelines through the Artifactory Extension, and push the generated buildinfo metadata to Artifactory where it can be used to track and automate your builds.

Configuring DevOps Azure to use Artifactory with Conan tasks

Before You Start

To configure your builds to use Conan and Artifactory together, first download and install these tools.

Installing Conan

  1. Download and Install the Conan version that’s appropriate for your system.
  2. To use the Conan support provided by the JFrog Artifactory Extension you must configure a self-hosted agent that will enable Conan builds for your Azure Pipelines environment.

Installing the Artifactory Extension

  • Download the JFrog Artifactory Extension from the Visual Studio Marketplace and follow the installation instructions in the Overview.

When completed, proceed to create builds and access buildinfo from within Azure DevOps or TFS.

Steps to Follow

In these steps, you will set up Azure DevOps to use Artifactory and add Conan tasks to your build pipeline. Then you can set up to push the buildinfo from the Conan task to Artifactory.

STEP 1: Configure the Artifactory instance

Once the Artifactory Extension is installed, you must configure Azure DevOps to access the Artifactory instance.

To add Artifactory to Azure DevOps:

  1. In Azure DevOps, go to Project Settings > Service connections.
  2. Click + New service connection to display the list control, and select Artifactory.
  3. In the resulting Update Authentication for Artifactory dialog, enter the required server and credential information, and click OK.
    Update Authentication for Artifactory

STEP 2: Add a Conan task

Once your Artifactory connection is configured, you may add Conan tasks to your Build or Release pipelines.

To add a Conan task:

  1. Go to the Pipeline Tasks setup screen.
  2. In the Add tasks section, search for “Conan” in the task selection list.
  3. Select the Artifactory Conan task to add it to your pipeline.
    configure the conan command for the task
  4. In the new task, select which Conan command to run.
    add command task to run
  5. Configure the Conan command for the task.
    configure the conan command for the task

    Continue to add Conan tasks as you need for each pipeline.

STEP 3: Configure the Push task buildinfo to Artifactory

When the pipeline containing the Conan task executes, the task log shows all the information about the executed Conan command.
Push task buildinfo to artifactory
You can configure your Conan task to collect the buildinfo by selecting the Collect buildinfo checkbox when you create the task.enable collecting buildinfo

Once collected, the buildinfo can then be pushed as metadata to Artifactory.

To perform this, create an Artifactory Publish Build Info task to push the metadata to your Artifactory instance.
Artifactory Publish Build Info

After you run the pipeline, you will be able to see the build information for the Conan task in Artifactory.Create Upload and Publish Build Info

Accelerate with Artifactory

While we’ve focused here on Conan for C/C++ developers, Artifactory Extension for Azure Devops/TFS supports several other build types as well, such as npm for JavaScript and Maven for Java. The extension lets you capture information about deployed artifacts and resolved dependencies, and automatically collecting environment data associated with your builds that can be fully traced.

Haven’t experienced Artifactory yet? Start your free Artifactory trial on Microsoft Azure.  Also, be sure to get started with Azure Pipelines for free.

 

Related Articles:

Conan Cheat Sheet