The Package task

Synopsis

Packages the scripts folder for publishing it (either on a local or a NuGet Server).

Description

The Package task in an Azure DevOps database pipeline is responsible for creating a deployable package from your database code. This task is a critical step for continuous integration/continuous deployment (CI/CD) in database development, as it prepares your changes for deployment to various environments.

How to create the Package task

Create the dbForge DevOps Automation for SQL Server – Package task that will pack your scripts folder into a package:

As you can see, the file name is tied to the build number and is generated dynamically according to the template. The output file will be saved to the working folder of the agent.

The generated NuGet package is an intermediate package and should be published somewhere.

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.

  • Include database documentation

Select to add the documentation generated in dbForge DevOps Automation for SQL Server - Document task to the package.

Source

  • Database folder

Select whether the database source project is located in the repository’s root directory or within a subfolder path.

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?