Giter VIP home page Giter VIP logo

vsts-variable-tasks's Introduction

Donate Build Status Join the chat at https://gitter.im/jessehouwing/vsts-variable-tasks

Release Notes

17-11-2017

  • Fixed: Set Build.BuldNumber doesn't work on most recent Windows Build agents. Updated to VSTS-Task-Lib 2.1.0 to fix.

1-9-2016

  • Fixed: Expand Variable Task throws an error on Agent 2.x, you can now remove this task, it is no longer needed. The new agent will automatically expand all variables.

20-5-2016

  • Removed: Preview flag

19-5-2016

  • Fixed: Replace with "" would result in "nullOriginalValue"

Description

This Extension contains a slowly growing collection of tasks that help you manipulate and (soon) validate the values of build variables.

Set Variable

Have you ever wanted to change the value of a variable between multiple build steps? Simply add the Set Variable task to your workflow and tell it which value you want to assign to which variable.

You can use the value of other build variables to setup the value.

Set: 'Build.DropLocation' to '\\share\drops$(Build.DefinitionName)$(Build.BuildNumber)'

  • Variablename: Build.DropLocation
  • Value: \\share\drops\$(Build.DefinitionName)\$(Build.BuildNumber)

By assigning to the Build.BuildNumber variable, the build number of the Build will be updated/overwritten.

Transform value and assign to Variable

If you need to do more advanced transformations of your values, use the transform task. You can use it to encode/decode the value and apply a number of simpe string manipulations, including Search & Replace, Change Case, Trim, Pad etc.

You can use the value of other build variables to setup the value.

Transform: 'your value here' and assign to Variable: VariableName'

  • Input Value: \\share\drops\$(Build.DefinitionName)\$(Build.BuildNumber)
  • Variablename: Build.DropLocation

By assigning to the Build.BuildNumber variable, the build number of the Build will be updated/overwritten.

You can apply the following manipulations (they'll be exectuted in the specified order):

Manipulation

  • Search & Replace
  • Use: Basic
  • Search: $Build.DefinitionName
  • Replacement: %%Placeholder%%
  • Trim
  • Slice
  • Substring
  • Change Case
  • Pad

And finally you can transform (encode/decode) the string using:

  • Base64
  • Uri
  • UriComponent
  • AddSlashes / StripSlashes

Expand Variables [DEPRECATED]

Have you ever wanted to use the value from one variable in another variable? Unfortunately, that's not possible with the standard Variables screen.

Variable Value
Build.DropLocation \\share\drops$(Build.DefinitionName)$(Build.BuildNumber)

Will simply send the literal text to the tasks in your workflow.

Add the Expand Variable(s) task to the top of your build steps and it will take care of the expansion for you. It even supportes multiple levels of nested variables!

Expand variable: 'Build.DropLocation'

  • Variablename(s): Build.DropLocation

Will expand your drop location variable to:

Variable Value
Build.DropLocation \\share\drops\My Definition\My Definition_1.2.123

And to make your life easier it now supports simply expanding all your variables!

Expand variable: '*'

  • Variablename(s): *

Documentation

Please check the Wiki.

If you like this extension, please leave a review and feedback. If you'd have suggestions or an issue, please file an issue to give me a chance to fix it.

vsts-variable-tasks's People

Contributors

jessehouwing avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.