Azure DevOps Retain Task

Add and Update pipeline retention lease in YAML pipelines

PowerShell Node.js MIT License

About The Project

This project provides an Azure DevOps task for managing pipeline retention leases in YAML pipelines. It allows you to set and update retention policies for your builds, ensuring your pipeline artifacts are retained for the specified duration.

YAML Definition Example

- task: SetRetention@0
  inputs:
    daysValid: 30
  env:
    SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Built With

Getting Started

This section provides instructions on setting up the project locally.

Prerequisites

  • npm (Node Package Manager)
  • PowerShell
  • VSCode
  • Git

Installation

Follow these steps to set up your development environment:

1. Install Node.js

choco install nodejs -y

2. Install TFX (Azure DevOps CLI)

npm install -g tfx-cli

3. Install PowerShell Extension for VSCode

code --install-extension ms-vscode.powershell

4. Install GitHub CLI

choco install gh -y

5. Clone the Repository

git clone https://github.com/wkalter/AzureDevOpsRetainTask.git

Usage

This task can be used in your Azure DevOps YAML pipelines to automatically set retention leases on your builds. This is useful when you want to ensure that specific builds are retained for a certain period of time.

Example Usage

Add the task to your pipeline YAML file with the desired retention period in days. Make sure to provide the System.AccessToken in the environment variables for authentication.

Roadmap

Here's what's planned for this project:

  • Completed - Initial version released
  • Completed - License added
  • Pending - Exception handling and logging
  • Pending - Examples for usages
  • Pending - Automated tests
  • Pending - Automated workflow for publishing to marketplace
    • Automated Testing
    • Automated package creation
    • Publish to marketplace

View open issues →

Contributing

We welcome contributions! If you have suggestions for improvements, please follow these steps:

  1. Fork the Project on GitHub
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Don't forget to give the project a ⭐ star! Thanks!

License

This project is distributed under the MIT License. See LICENSE.md for more information.

Contact

Wessel Kalter
LinkedIn Profile →

Project Repository:
github.com/wkalter/AzureDevOpsRetainTask →

Acknowledgments

Special thanks to the following resources: