Skip to content

tokenPattern works! but equivalent tokenPrefix and tokenSuffix not! #80

@ewertonmattoslumon

Description

@ewertonmattoslumon

This works fine and perform and the replacements it should

 - task: qetza.replacetokens.replacetokens-task.replacetokens@6
            displayName: 'Replacing Variables from Azure Devops Library in JavaScript & HTML'
            inputs:
              rootDirectory: '$(System.DefaultWorkingDirectory)/dist/my-angular-app/browser'  # Folder containing files
              targetFiles: |
                *.js
                *.html
              encoding: 'auto'
              tokenPattern: 'octopus'  # Supports Octopus style '#{VariableName}''
              missingVarLog: 'error' # off | Warn | error - if tokens are missing              
              logLevel: 'debug'  # Set log level to info for cleaner output

This is equivalent but when used, no replacement accurs.

 - task: qetza.replacetokens.replacetokens-task.replacetokens@6
            displayName: 'Replacing Variables from Azure Devops Library in JavaScript & HTML'
            inputs:
              rootDirectory: '$(System.DefaultWorkingDirectory)/dist/my-angular-app/browser'  # Folder containing files
              targetFiles: |
                *.js
                *.html
              encoding: 'auto'
              tokenPrefix: '#{'
              tokenSuffix: '}'
              missingVarLog: 'error' # off | Warn | error - if tokens are missing              
              logLevel: 'debug'  # Set log level to info for cleaner output

Additional Info:

  • Angular application, file environments.prod.ts looks like this:
    export const environment = {
        production: true,
        environmentName: '#{environmentName}',
        location: '#{location}',
        mySampleConfig: '#{MySampleConfig}'
    };
  • Pipeline running on Azure Devops, all variables are configured in Azure Devops Library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions