HTTP
This extension provides bellow tasks!
TemplateInline ✴️
TemplateRender ✴️
Regex ✴️
Replace ✴️
PlaceInFiles
- ~~
Base64 ~~ ⚠️ deprecated! use TemplateInline or TemplateRender with {{ myvar | base64 }} or {{ myvar | base64(true) }} pipes.
- ~~
RegexReplace ~~ ⚠️ deprecated! use Replace .
- ~~
NunjucksInline ~~ ⚠️ deprecated! use TemplateInline
- ~~
NunjucksRender ~~ ⚠️ deprecated! use TemplateRender
- ~~
RegexMatch ~~ ⚠️ deprecated! use Regex
- ~~
UUID ~~ ⚠️ deprecated! use TemplateInline or TemplateRender with {{ faker.string.uuid() }}
Features
- Replace contents using ECMAScript
Regex expressions from/to File, Variable or Raw Text expression.
- Render templates with
Nunjucks templates from/to File, Variable or Raw Text expression and nunjucks-steroids .
- Render multiple
Nunjucks templates using inline operations with nunjucks-steroids too 😉.
- Replace Variables or Secrets on files.
Templates use Nunjucks engine with Nunjucks Steroids.
Usage sample
- job:
...
steps:
- task: Replace@4
inputs:
source: 'hello world'
destination: 'echo'
regex: '/(hello )(world)/ig'
substitution: '$1 frank $2'
- task: Regex@4
inputs:
source: 'hello world'
regex: '/(hello )(world)/ig'
prefix: 'HELLO_'
- task: TemplateRender@4
inputs:
source: |-
my static content prefix
{{ MY_ENV | _classify }}
my static content sufix
destination: 'echo'
# destination: 'file://./rendered.txt'
# destination: 'var://RENDERED_VAR_NAME'
env:
MY_ENV: my new text
- task: TemplateInline@4
inputs:
source: |
var pascal_name = BUILD_REPOSITORY_NAME | pascalCase
var base64 = BUILD_REPOSITORY_NAME | encode64
var id = {{ faker.string.uuid() }}
echo {{ BUILD_REPOSITORY_NAME | pascalCase }} -- {{ BUILD_REPOSITORY_NAME | encode64 }}
- task: PlaceInFiles@4
inputs:
globPattern: '*.txt'
# Regex Expression, MUST HAVE ONE MATCHING GROUP
regex: '/#{([^}]+)}#/ig' # matches '#{ MY_VARIABLE }#' '#{ MY_VARIABLE | base64 }#' '#{ MY-SECRET }#'
env:
MY_SECRET: $(MY-SECRET) # dasherized (-) variables names must converted to undescored (_) to use in complex expressions
# ⚠️ deprecated! use `Replace`.
- task: RegexReplace@4
inputs:
sourceType: 'text'
source: 'hello world'
destType: 'text'
regex: '/(hello )(world)/ig'
substitution: '$1 frank $2'
# ⚠️ deprecated! use `Regex`.
- task: RegexMatch@4
inputs:
sourceType: 'text'
source: 'hello world'
regex: '/(hello )(world)/ig'
outVarPrefix: 'HELLO_'
# ⚠️ deprecated! use `NunjucksInline` or `NunjucksRender` with `encode64` or `decode64` pipes.
- task: Base64@4
displayName: "Encode"
inputs:
source: mycontent
dest: MY_ENCODED_64_VAR
# ⚠️ DEPRECATED use TemplateRender@4
- task: NunjucksRender@4
inputs:
sourceType: 'text'
source: |-
my static content prefix
{{ MY_ENV | _classify }}
my static content sufix
destType: 'text'
env:
MY_ENV: my new text
# ⚠️ DEPRECATED use TemplateInline@4
- task: NunjucksInline@4
inputs:
sourceType: 'text'
source: |
var pascal_name = BUILD_REPOSITORY_NAME | pascalCase
var base64 = BUILD_REPOSITORY_NAME | encode64
echo {{ BUILD_REPOSITORY_NAME | pascalCase }} -- {{ BUILD_REPOSITORY_NAME | encode64 }}
# ⚠️ DEPRECATED use TemplateInline@4 or TemplateRender@4 with {{ faker.string.uuid() }}
- task: UUID@4
inputs:
amount: '3'
variablePrefix: MY_UUID_VAR_
About US
Help us
See CONTRIBUTING.md
If you like our project help us to make more best solutions.
Bitcoin / network BTC :
1NvnQAp2e46Fqv4YaoYTioypJZdq4Kc3Az
Etherium / network Etherium :
0x38a2113604fb3d642bbd009301e94848a499cea4
BitTorrent / network Tron :
TD9LHa5BjWQpf4oP3uYWP8ghnojJWJy53C
| |