Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Replaces strings in files in a specific folder. See plugin inputs below for details about how to create the filters necessary to select the files you wish.

The string that is used as the needle can be a plain string or a regular expression.

This operation is suitable for files < 100MB, but not for very large files. The files are stored fully in memory during the replacement. Matching files are overwritten with the modified text. Files that seem to be binary in nature are skipped in this operation.

Inputs

Input Name

Input Code

Required

Description

Source Path

FDFILE_INP_SOURCE_PATH

No

The source directory path, files in this folder are eligible for property replacement. The FD_TEMP_DIR and FD_ARTIFACTS_DIR variables work great in this field.

File Filter

FDFILE_INP_FILE_FILTER

No

Wildcard compatible expression to select file(s). You can enter multiple filter expressions separated by ##. Leave empty to select all files. The ## performs an OR expression. This will filter Files or Directory names but not the path. (e.g. for "/this/is/a/test/path" if you use "path" it will filter it, if you use "/this/is/a/test/path" it will not)

Here are some examples and expected behaviors:

Filter Text

Result

.properties##.xml##.conf##.temp

selects all .properties, .xml, .conf, and .temp files and  folders.

*.war

selects all .war files

*.war##important.xml##readme.md

selects all .war files, important.xml, and readme.md

File Exclude Filter

FDFILE_INP_FILE_FILTER_EXCLUDED

No

Wildcard compatible expression to exclude file(s) OR folders. You can enter multiple filter expressions separated by ##. Leave empty to select all files. The ## performs an OR expression. This will filter Files or Directory names but not the path. (e.g. for "/this/is/a/test/path" if you use "path" it will filter it, if you use "/this/is/a/test/path" it will not)

Here are some examples and expected behaviors:

Filter Text

Result

svn##.git##*.temp

excludes any .temp, svn, .git files and folders

*.war

excludes all .war files

*.tmp##boring.xml##readme.md

excludes all .tmp, boring.xml, and readme.md files

Combining include and exclude filters

File Filer

File Exclude Filter

Result

.war##.jar

badProject

select all .war and .jar files, unless there is a folder named badProject in its path

.war##.ear

badProject.war

select all .ear and .war files, except badProject.war


*.tmp##boring.xml##readme.md

select everything except all .tmp files, boring.xml, and readme.md

*.war


select all .war files

Important.*

*.class

select all files that start with Important, unless they end in .class

Replace List

FDFILE_INP_REPLACE_LIST

Yes

A list of strings and values to be replaced. Formatted as key=value. One pair per line.

${HRService.url}=${{SOA_BASE_URL}}/soa-infra/services/defaults/HRService/HRService?WSDL
${OrderService.url}=${{SOA_BASE_URL}}/soa-infra/services/defaults/OrderService/OrderService?WSDL

Lines that begin with "#" are ignored

Lines that begin with an "@" will try to load a file. If it is a relative path, it will first check the artifacts directory and then the temp directory. For example, @replace.conf. Any files loaded from will also be excluded from being replaced.

Expresion

If you are using expression, please make sure to use \n between the key=value pairs.

"Remark=" + FDBLD_PACKAGE_VERSION_SEQUENCE + "\n" +
"Package=" + FD_PACKAGE_NAME

Whole Word Only

FDFILE_INP_REPLACE_WHOLE_WORD_ONLY

No

Should matches only be found when surrounded by word boundaries such as a space, punctuation, or the beginning or end of a line?

Case Insensitive

FDFILE_INP_CASE_INSENSITIVE

No

Should matches be performed case-insensitively?

Quote Pattern

FDFILE_INP_QUOTE_PATTERN

No

If true, the needle will be treated literally as a string. If false, the needle is a regular expression.

Artifacts

This operation delegates consumes/produces artifacts decision to the workflow developer. Check Consumes Artifacts on the workflow step editor if this operation requires artifacts to be delivered prior to execution of the script. Check Produces Artifacts on the workflow step editor if this operation creates artifacts. The artifacts folder is available via the FD_ARTIFACTS_DIR variable.

Endpoint Selection

This operation delegates endpoint selection to the workflow developer. The workflow editor will default the selection to "All", which selects all available endpoints associated to the Target. Selecting a specific resource will result in selection of endpoints associated to the Target which have that resource defined.

Endpoint Execution

This operation delegates endpoint execution to the workflow developer. The workflow editor will default to "Any", which will execute on any one of the selected endpoints, which will be randomly picked from selected endpoints or a specific endpoint where previous step may have executed. Changing this value to "All" to will result in execution on all selected endpoints.


  • No labels