# ========================================================================
# Modify this file freely, it allows you to build a set of rules to deploy a file (r-code or any file)
#
# ======================
# Two type of rules exist :
# 
# - Filter rules : they define which files are eligible to the deployment
# - Transfer rules : they define when / where / how a file should be deployed
# 
## ======================
# Each Filter rule as 5 components separated by tabulations :
# step	name	suffix	type	source_pattern
# 
# - The deployment step : integer (a rule is always defined for a particular step)
# - The application name filter : If the application name of your current environment matches this filter (you can use wildcards), the rule can apply 
# - The application suffix filter : If the application suffix of your current environment matches this filter (you can use wildcards), the rule can apply 
# - Rule type : `+` / `-` (or `Include` / `Exclude`) decide if the files matching the *source path pattern* below are included or excluded from the deployment
# - The source path pattern : when deploying, if a file matches this pattern (you can use wildcards), the rule can apply
# 
## ======================
# Each transfer rule as 7 components :
# step	name	suffix	type	next?	source_pattern	deploy_target
# 
# - The deployment step : integer (a rule is always defined for a particular step)
# - The application name filter : If the application name of your current environment matches this filter (you can use wildcards), the rule can apply 
# - The application suffix filter : If the application suffix of your current environment matches this filter (you can use wildcards), the rule can apply 
# - The transfer type : `Move` / `Copy` / `Prolib` (the file will be added to a progress library .pl) / `Zip` / `Cab` / `Ftp` (the file will be sent to an ftp server) / `Ftp` (see next paragraph for more details)
# - Execute further rules : `yes` / `no` : yes if more rules can be applied after this one, no to stop at this rule
# - The source path pattern : when deploying, if a file matches this pattern (you can use wildcards), the rule can apply
# - The transfer target : The path in which the file will be deployed. It can either be an absolute path or a relative one; If relative, it will be relative to the deployment base directory set for your current environment. If the transfer type is `Zip` / `Cab` / `Prolib` then the target should be a file with the corresponding extension (ex : target.zip). It is also possible to use the | character to separate several target path (the file will then be copied to the different locations)
#
## ======================
# Type of transfers :
# - Move
# - Copy
# - Prolib : the deployment target must then contain a .pl file, you can adopt the syntax `file.pl\mysubfolder\` to put the file into a special path inside the .pl
# - Zip : Same as Prolib, for zip files
# - Cab : Same as Prolib, for cab files
# - Ftp : the deployment target must follow the syntax `ftp://username:password@server:port/distant/path/` with username, password and port being optionnal; `/distant/path/` represents the path on the ftp server on which to put the deployed file
# 
#
## ======================
# The following rules are applied during a deployment, work around them to get exactly what you need :
# 
# **Rules sorting (from most important to less important) :**
# 
# - exact application name first
# - longer application name filter first
# - exact application suffix first
# - longer application suffix filter first
# - rules with *execute further rules* = `yes` first
# - `Prolib` before `Zip` before `Ftp` before `Copy` before `Move`
# - rules defined first, first (line number in the file)
# 
# **Other rules :**
# 
# - A file can have several rules applied to it; however, the first `Move` rule encountered will be the last rule applied
# - When no filter rules are defined then all the files are considered (this is only true if there are NO filter rules AT ALL for a given step)
# - For step 0, if no transfer rules can be applied to a file, then the file will be `Moved` to the deployment base directory by default
# - For other steps, if no transfer rules apply then the file is not transfered at all
# - For step 0, if the environment is set to `compile next to source` then the *.r will be moved next to the source and no transfer rules will apply
## ======================
# EXTRA :
#
# **Using regular expressions :**
#
# If you wish, you can also directly use regular expression in the "source pattern" for the transfer. If you do so, you can then use capturing groups and
# use $1, $2... in the "deploy target" to dynamically rename the "deploy target" in function of the source
# You can also use regular expression for filter rules in the "source_pattern"
# To activate this feature, the "source pattern" and "deploy target" should start with the character ":"
#
# **Using "variables" :**
#
# You can define variables on a line with info separated by tabulations; the format is :
# name	suffix	<var_name>	path
# The <var_name> is then replaced in the transfer rules by the value of the "path"
# You can also use the special variable <ROOT> which is always available and is replaced by the
# path to your source directory (without the ending '\')
# See the example below for a better understanding
# ========================================================================

# Example of variables (commented with #)
##############################################
#name	suffix  	<var_name>    	path
##############################################
*   	*       	<myvar>     	C:\temp

# Example of filter rules (commented with #)
##############################################
#step	name	suffix	type    	source_pattern
##############################################
#1  	*   	*   	Include 	*.filetype
#1  	*APP*	*   	+       	*\folder\*
#1  	APP??	start* 	Exclude 	*specific_numbered_file_???.txt
#1  	APP??	start* 	-       	*\file_starting_with*
#0  	*   	*   	-       	:\\(tmp|temp|trash)\\

# Examples of transfer rules (commented with #) :
#####################################################################
#step	name	suffix	type	next?	source_pattern	deploy_target
#####################################################################
#0  	*   	*   	Ftp 	yes 	*myfilter\*  	ftp://progress@127.0.0.1/myfolder/deploy/
#0  	*APP*	deploy*	Prolib	No  	*myfilter\*  	file.pl
#1  	*   	*   	Zip 	no  	*.myfilter  	file.zip
#1  	APP??	*   	Copy	yes 	*.thing     	C:\temp\
#1  	*   	*   	Move	no  	*.thing     	<myvar>\2\
#0  	*   	*   	Prolib	no  	:^.*\\(module1|module2|module3)\\serveur\\.*$	:serveur\$1.pl