Skip to main content
Version: Deploy 23.3

Property Placeholder

How to use property placeholders in JavaScript files for specific projects without affecting others?

To use property placeholders in JavaScript files, you must enable a delimiter configuration for CI types, specifically for file.Archive, file.File, and file.Folder. This configuration allows you to use a different delimiters from the original {{ }} delimiter.

Tip: As indicated by our customers' experience, the 2-character delimiter "@} {@" was successfully used as it didn't interfere with JavaScript or its dependent libraries. Check your specific case when selecting the delimiter.

Each CI type requires updated configuration as follows:

<type-modification type="file.Archive">
<property name="delimiters" hidden="false" />
</type-modification>

For example, update a configuration file synthetic.xml to extend file.Archive to a generic CI.

<!-- delimiter.file.Archive -->
<!-- Description: expose the delimiters property so that it can be set on the CI -->
<type type="delimiter.file.Archive" extends="file.Archive">
<property name="delimiters" kind="string" hidden="false" required="false"/>
</type>

And in the deployables YAML configuration:

```deployables:
name: sample.zip
type: delimiter.file.Archive
file: !file "../#{Build.BuildNumber}#.zip"
targetPath: /tmp/#{Build.BuildNumber}#
createTargetPath: True
scanPlaceholders: True
preScannedPlaceholders: False
excludeFilenamesRegex: /*(.html).*
delimiters: '@} {@'
# Add a condition to scan only JS files
conditions:
- type: file
pattern: "**/*.js"

For more information on updating the configuration for each CI type, see Customize an existing CI type.

For more information on placeholder delimiters, see Using Placeholders in Deployments.