Skip to content

n3wt0n/AzurePipelinesDecoratorSamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Pipelines Decorator Samples

CI License time tracker

A series of sample Decorators for Azure Pipelines (Build and Release).

Decorators in this repo work only with Azure DevOps (they are not available in Azure DevOps Server).

Check the official documentation here and here for more information about Azure Pipelines decorators.

Intro to Decorators

I explain more about Pipelines Decorator in my blog post here

If you want to have a step-by-step guide on how Decorators work and how to structure them, check out my video:

Pipelines Decorators on CoderDave

In the video I actually reference this repo and its content.

About this repo structure

There are 2 types of Basic Decorators in this repo:

  • Build: The Decorators in this folder work with both the Classic Build pipelines and the Multistage (YAML) pipelines.
    • When running in YAML pipelines, they are applied to both Jobs and Deployment Jobs
  • Release: The Decorators in this folder work only with the Classic Release pipelines.

In each of the previous folder, there are three other folders:

  • Pre: this decorators run before any other task in the pipeline
  • Post: this decorators run after any other task in the pipeline
  • PrePost: this decorators run both before and after any other task in the pipeline

The Advanced folder instead contains some different examples of slightly more advanced decorators, with specific implementations.

Getting Started

To keep things simple, each folder contains a standalone decorator extension.

Pick the one you want to use and follow the steps below.

For prerequisites take a look here

Build and Package the extension

First you need to install all the Node.js dependencies:

npm install

Then you need to actually create the extension:

tfx extension create

This will generate the .vsix package file

Remember to change the Publisher in the vss-extension.json file with your publisher

Publish the extension

When you have the extension file, head to the marketplace management portal and add the new extension.

You will also need to share the extension to your organization.

Only private extensions can contain Decorators, so be sure not to make it public.

For more info take a look at: https://docs.microsoft.com/en-us/azure/devops/extend/get-started/node?view=azure-devops#package-and-publish-your-extension

Install the extension

Once shared with your Azure DevOps Organization, you can head to the Manage Extensions tab under Organization Settings, go to Shared and finally install your Decorato Extension.

For more info take a look at: https://docs.microsoft.com/en-us/azure/devops/extend/get-started/node?view=azure-devops#install-your-extension

About

A series of sample Decorators for Azure Pipelines (Build and Release), plus some more Advanced ones

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published