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
This works fine and perform and the replacements it should
This is equivalent but when used, no replacement accurs.
Additional Info:
environments.prod.tslooks like this: