Have a question? Want to report an issue? Contact JFrog support

Skip to end of metadata
Go to start of metadata

Overview

Artifactory brings continuous integration to Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) through the JFrog Artifactory VSTS Extension. 

 The JFrog Artifactory VSTS extension supports:

  • Resolving your build dependencies from Artifactory 
  • Deploying your build artifacts to Artifactory. 
  • Gaining full traceability of your builds by capturing your build-info from your builds and publishing to Artifactory.

Source Code

The extension is an open-source project on GitHub which you can freely browse and fork.

Installing the Extension

The VSTS Artifactory extension is available in the VSTS Marketplace.

To install the VSTS Artifactory extension, execute the following steps:

  1. Sign in to your VSTS account and go VSTS marketplace. 
  2. Select the JFrog Artifactory extension located under in the Build and Release section.
  3. On the VSTS Artifactory Extension page, click Install.
  4. Select the account to which you want to apply the plugin and confirm installation.
Page Contents

Installing the Build Agent

If your build agent has access to the internet, no manual setup is required and you can skip this section.

The extension runs JFrog CLI in the background to run many of its operations. The extension automatically downloads and installs the JFrog CLI on your build agent the first time it's required. However, if your build agent does not have access to the internet, the build will fail when attempting to download JFrog CLI and you'll need to download and install it manually.

Follow these steps to install JFrog CLI on an agent which does not have internet access:

  1. Create the directory structure on your agent's file-system: <agent_dir>/<agent_work_dir>/_jfrog/jfrog-cli/current/.
  2. Download JFrog CLI version 1.17.1 from Bintray. Please make sure to download the executable matching your agent's operating system.
  3. Place the downloaded JFrog executable in the "current" directory that you created.

Configuring the Artifactory Service Endpoint

To allow your builds to work with Artifactory, you'll need to configure your Artifactory instance as a Service endpoint.

  1. Access your VSTS project and click Project Settings > CI/CD > Service endpointsNew service connection and select Artifactory.
  2. Configure the details of the Artifactory instance.

Make sure that the URL of the Artifactory instance does not end with a slash.

Downloading Generic Dependencies from Artifactory

The Artifactory Generic Download task supports downloading your build dependencies from Artifactory to the build agent.
The task triggers the JFrog CLI to perform the download in the background and are defined using File Specs and can also be configured to capture the build-info.
The task stores the downloaded files as dependencies in the build-info which can later be published to Artifactory using the Artifactory Publish Build-Info task.

When configuring the task, select your configured Artifactory service endpoint, specify the File Spec and indicate whether to collect build-info for this task.

Artifactory Generic Download

Uploading Generic Artifacts to Artifactory

The Artifactory Generic Upload task supports uploading your generated build artifacts from the build agent's local file system to Artifactory.
The task triggers the JFrog CLI to perform the upload in the background.
The artifacts are defined using File Specs and can also be configured to capture build-info as it stores the uploaded files as artifacts in the build-info. The captured build-info can be later published to Artifactory using the Artifactory Publish Build-Info task.

When configuring the task, select your configured Artifactory service endpoint, configure the File Spec and indicate to collect build-info for this task.

BuildInfo

Publishing Build Info to Artifactory

The Artifactory Generic Download and Artifactory Generic Upload tasks can be configured to collect and store build-info locally. The collected build info can be then published to Artifactory using the Artifactory Publish Build Info task.

For more information about Build Info, see Artifactory Build Integration.

When configuring the task, select your configured Artifactory service endpoints and specify whether you'd like to collect environment variables from the agent and add them to the build-info.

After the build-info is published to Artifactory, it can be accessed from the Artifactory tab in the Build Results.

BuildInfo

BuildInfo

Promoting Published Builds in Artifactory

To support the artifacts life-cycle, Artifactory supports promoting published builds from one repository to another.

The Artifactory Build Promotion task promotes a build, by either copying or moving the build artifacts and/or dependencies to a target repository.
This task can be added as part of a Build or Release pipeline.

Run these steps to configure the Artifactory Build Promotion task:

  1. Select the configured Artifactory Service, to which the build has been published.
  2. Specify the name of a Target repository to which the build should be promoted.
  3. Set the Status of the build and optionally add a Comment. These details will be visible as part of the Build History in the Artifactory UI.
  4. (Optional) Set a Source repository for the promotion. 
  5. Unselect the Copy/move build dependencies field to move or copy only the build artifacts the target repository.
  6. To copy and not to move the artifacts to the target repository, select the Copy artifacts option to copy the artifacts to the target repository.
  7. Select Dry run to test the promotion prior to running the build promotion.

BuildInfo

Using Build Promotion in a Release

You can control the life cycle of your artifacts by promoting them from one Artifactory repository to another. Build Promotion can come in handy when embedding it as part of release pipeline in VSTS. To help you achieve this, follow these steps for creating a release which includes the Artifactory Build Promotion task.

  1. Create a new Release.
  2. Click Environment and select a template for the release.
  3. Click Artifact and select Build as the source type.
  4. Fill out the rest of the form details and make sure to select Specify at the time of release creation as the Default version. Selecting this option allows you to select the version (i.e build number) to promote, when creating a release).
  5. Add and configure the Artifactory Build Promotion task as one of your release pipeline tasks.
    The task uses a build number which will be selected later on, upon creating a release.
  6. That's it your done!
    Now you can create the release. The build number that you'll choose is that one which will be promoted in Artifactory.

Release Notes

1.0.6 (August 15th, 2018)

  1. Reduced the extension size.
  2. Bug fix - Paths with white-spaces are not working properly on Windows agents.

1.0.4 (August 12th, 2018)

  1. Bug fix - Modified the Artifactory Generic Upload and Download tasks to use System.DefaultWorkingDirectory by default.
  2. Bug fix - Artifactory Generic Upload and Download tasks failed with error on Release.
  3. Artifactory Promotion task - Change Source and Target Repository fields to be drop down lists.

1.0.3 (August 9th, 2018)

  1. Bug fix - Generic Upload and Generic Download tasks on Windows can fail when using variables.

1.0.2 (July 30th, 2018)

  1. New Generic Upload and Generic Download tasks.
  2. New Promotion task.
  3. New Publish Build Info task.
  • No labels