Skip to main content
Skip table of contents

Properties Config Command

Purpose

Replaces variables in specified files using a properties file. It will use any environment variables on the system and variables defined in a properties file.

This command is invoked by your build system agent and executes under the user account you configured for that agent in your build system. The command itself does not require any credentials as it runs natively on your MettleCI Agent Host.

Syntax

Syntax : properties config [options]

Description

  • -baseDir

    The directory to look for files in

    Required

  • -filePattern

    Pattern to use to find files (can provide multiple. e.g: -filePattern dir1/* -filePattern dir2/*)

    Required

  • -properties

    Properties file with replacement values

    Required

  • -outDir

    Directory to write modified files to

    Required

Example

BASH
$> mettleci properties config 
   -baseDir datastage 					# Only consider files under 'datastage' folder in git
   -filePattern "DSParams" 				# Substitute values in the 'DSParams' file
   –filePattern "Parameter Sets/*/*"  	# ... and in the Parameter Set value files
   -properties var.uat   				# Use a Variables Properties file specific to (in this example) the UAT environment
   -outDir config						# Output updated files to separate directory

The properties file is in a key/value pair format, e.g:

CODE
mettleci.prop1=value1
mettleci.prop2=value2
prop3=value3

Variables in files to be replaced need to be defined in the format ${VARIABLE_KEY}, e.g:

BASH
export MY_FIRST_PROPERTY=${mettleci.prop1}
export MY_SECOND_PROPERTY=${mettleci.prop2}
cat FILE | grep ${prop3}


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.