The Publish task

Synopsis

Publishes the database project as NuGet package to the NuGet repository.

Description

The Publish task in an Azure DevOps database pipeline is used to release or deploy the build artifact to a target environment.

How to create the Publish task

To create the Publish task, select dbForge DevOps Automation for SQL Server – Publish. It will use the package file generated in the Package step as input. As you can see these two tasks have the same file name template. The Publish task settings are shown below.

In the example above, we the package will be published to a local drive. If you want to publish the package on a package server, for example, "https:⁄⁄www.nuget.org", then you will need to set the API key parameter. The value for this parameter will be the token that is issued on this server.

Customization options

  • Package

  • ID

Enter the output package file name. The format is as follows: {name}.{major}.{minor}.{build}. You can use the $(Build.BuildNumber) variable to customize it for a build pipeline or the $(Release.ReleaseId) variable to customize it for a release pipeline.

  • Package folder

Specify whether the NuGet package is situated in the root directory of the repository or within a specified subfolder path.

NuGet Feed

  • URL or packages source key

Enter URL or package source key for the target NuGet feed.

  • API key

Enter the NuGet feed API key if your deployment target is the NuGet repository.

Control Options

  • Enabled

Select to enable the task in your pipeline. If a task is disabled, it will be skipped during the pipeline execution.

  • Continue on error

Select to continue the pipeline running even if this task fails.

  • Number of retries if task failed

Specify the number of retries for this task that will happen in case of task failure.

Note

This requires agent version 2.194.0 or later. Not supported for agentless tasks.

  • Timeout

Specify the maximum time, in minutes, that a task is allowed to execute before being canceled by server. A zero value indicates an infinite timeout.

  • Run this task

Specify when this task should run. Choose Custom conditions to specify more complex conditions.

Here you can select from the following options:

  • Only when all previous tasks have succeeded
  • Even if a previous task has failed, unless the build was canceled
  • Even if a previous task has failed, even if the build was canceled
  • Only when a previous task has failed
  • Custom conditions

Output Variables

  • Reference name

Any changes to the reference name will require updates to downstream tasks that uses this reference name, a valid reference name can only contain ‘a-z’, ‘A-Z’, ‘0-9’ and ‘_’.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge DevOps Automation for SQL Server.
Request a demo

Request a demo

If you consider employing the DevOps Automation for your business, request a demo to see it in action.
Ready to start using dbForge DevOps Automation for SQL Server?