Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

folder_mappings

Marcel Kloubert edited this page Jun 5, 2017 · 7 revisions

Home >> Targets >> Folder mappings

Folder mappings

In the following example, all files inside /dist folder of the workspace will be deployed to /my_package_files of the FTP server instead of /my_package_files/dist.

{
    "deploy": {
        "targets": [
            {
                "type": "ftp",

                "host": "ftp.example.com", "port": 21,
                "user": "mkloubert", "password": "P@assword123!",

                "dir": "/my_package_files",

                "mappings": [
                    {
                        "source": "/dist",
                        "target": "/"
                    }
                ]
            }
        ]
    }
}

You also can use regular expressions for the sources:

{
    "deploy": {
        "targets": [
            {
                // ...

                "dir": "/my_package_files",

                "mappings": [
                    {
                        "source": "^(\/dist\/app)([0-9]+)",
                        "isRegEx": true,

                        "target": "/app/${2}"
                    }
                ]
            }
        ]
    }
}

The upper example will deploy all files in /dist/app1 to /my_package_files/app/1, /dist/app5979 to /my_package_files/app/5979, /dist/app1781 to /my_package_files/app/1781 etc.

Name Description
isRegEx Indicates if source contains a regular expression instead of a static value. Default: (false)
source* The source directory.
target** The directory on the target machine.

* supports placeholders
** supports placeholders, but only if isRegEx = (true)

Clone this wiki locally