qetza / vsts-replacetokens-task

[ARCHIVED] Visual Studio Team Services Build and Release extension that replace tokens in files with variable values.. Project moved to https://github.com/qetza/replacetokens-task
MIT License
164 stars 56 forks source link

[ARCHIVED] Replace Tokens task

donate

This GitHub project has been archived. Ongoing development on this project can be found in https://github.com/qetza/replacetokens-task.

Azure Pipelines extension that replace tokens in text files with variable values.

Usage

If you are using the UI, add a new task, select Replace Tokens from the Utility category and configure it as needed:

Replace Tokens parameters

If your are using a YAML file, add a task with the following syntax:

- task: qetza.replacetokens.replacetokens-task.replacetokens@3
  displayName: 'Replace tokens'
  inputs:
    targetFiles: |
      **/*.config
      **/*.json => outputs/*.json

Note: the task will only work on text files, if you need to replace token in archive file you will need to first extract the files and after archive them back.

Parameters

The parameters of the task are described bellow, in parenthesis is the YAML name:

Output variables

The task creates the following as output variables:

Data/Telemetry

The Replace Tokens task for Azure Pipelines collects anonymous usage data and sends them to its author to help improve the product by default. If you don’t wish to send usage data, you can change your telemetry settings through Send anonymous usage telemetry parameter or by setting a variable or environment variable REPLACETOKENS_DISABLE_TELEMETRY to true.

Tips

If you want to use tokens in XML based configuration files to be replaced during deployment and also have those files usable for local development you can combine the Replace Tokens task with the XDT tranform task:

Release notes

New in 4.6.0

New in 4.5.0

New in 4.4.1

New in 4.4.0

New in 4.3.0

New in 4.2.1

New in 4.2.0

New in 4.1.0

New in 4.0.0

New in 3.7.1

New in 3.7.0

New in 3.6.0

New in 3.5.2

New in 3.5.1

New in 3.5.0

New in 3.4.1

New in 3.4.0

New in 3.3.1

New in 3.3.0

New in 3.2.2

New in 3.2.1

New in 3.2.0

New in 3.1.0

New in 3.0.0

New in 2.3.0

New in 2.2.1

New in 2.2.0

New in 2.1.0

New in 2.0.2

New in 2.0.0

New in 1.4.1

New in 1.4.0

New in 1.3.1

New in 1.3.0

New in 1.2.0