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:
- Create the directory structure on your agent's file-system: <agent_dir>/<agent_work_dir>/_jfrog/jfrog-cli/current/.
- Download JFrog CLI version 1.17.1 from Bintray. Please make sure to download the executable matching your agent's operating system.
- 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.
- Access your VSTS project and click Project Settings > CI/CD > Service endpoints > New service connection and select Artifactory.
- 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.
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.
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.
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:
- Select the configured Artifactory Service, to which the build has been published.
- Specify the name of a Target repository to which the build should be promoted.
- 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.
- (Optional) Set a Source repository for the promotion.
- Unselect the Copy/move build dependencies field to move or copy only the build artifacts the target repository.
- 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.
- Select Dry run to test the promotion prior to running the build promotion.
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.
- Create a new Release.
- Click Environment and select a template for the release.
- Click Artifact and select Build as the source type.
- 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).
- 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.
- 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.
1.0.6 (August 15th, 2018)
- Reduced the extension size.
- Bug fix - Paths with white-spaces are not working properly on Windows agents.
1.0.4 (August 12th, 2018)
- Bug fix - Modified the Artifactory Generic Upload and Download tasks to use System.DefaultWorkingDirectory by default.
- Bug fix - Artifactory Generic Upload and Download tasks failed with error on Release.
- Artifactory Promotion task - Change Source and Target Repository fields to be drop down lists.
1.0.3 (August 9th, 2018)
- Bug fix - Generic Upload and Generic Download tasks on Windows can fail when using variables.
1.0.2 (July 30th, 2018)
- New Generic Upload and Generic Download tasks.
- New Promotion task.
- New Publish Build Info task.