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

target_app

Marcel Kloubert edited this page Jan 4, 2018 · 20 revisions

Home >> Targets >> app

Apps or shell/batch scripts

Runs a shell command, that is used for deployment.

{
    "deploy.reloaded": {
        "targets": [
            {
                "type": "app",
                "name": "My App target",

                "app": "myDeployScript.sh",

                "deployFlag": "--deploy",
                "pullFlag": "--pull",
                "deleteFlag": "--delete",

                "platforms": [ "linux", "darwin" ]
            },

            {
                "type": "app",
                "name": "My App target",

                "app": "myDeployScript.cmd",

                "deployFlag": "--deploy",
                "pullFlag": "--pull",
                "deleteFlag": "--delete",

                "platforms": [ "win32" ]
            }
        ]
    }
}
Name Description
app* The (shell) command to execute.
appendOperationFlag If (true), the deploy operation argument will be append as last execution argument, but before the file list. Otherwise it will be submitted as first argument. Default: (false)
arguments* List of one or more arguments for the invokation or the path to a script that provides them.
asOneArgument Submit file list as one argument or not, separated by fileSeparator or not. Default: (false)
cwd* The custom working directory.
deleteFlag The optional operation flag argument, that the tells the command, that files should be deleted / uploaded.
deployFlag The optional operation flag argument, that the tells the command, that files should be deployed / uploaded.
fileSeparator* An expression that is used to concat a file list to one string. Default: ,
input* The value for stdin.
inputEncoding* The encoding for stdin to use.
inputIsScript If (true): input is the path to a script that provides the value for stdin. Default: (false)
inputScriptOptions Options for the input script.
outDirectory* The custom output directory.
pathSeparator* A custom separator for the file paths.
prependFileList If (true), the list of files will be added as first arguments. Otherwise it will be submitted as last arguments. Default: (false)
pullFlag The optional operation flag argument, that the tells the command, that files should be pulled / downloaded.
runInTerminal Run in integrated terminal of the editor or not. Default: (false)
submitFileList Submit file list or not. Default: (true)
usePlaceholders Use placeholder for arguments or not. Default: (false)
useRelativePaths Use relative file paths (if possible) or not. Default: (false)
wait Wait until execution has been finished. Has no effect, if runInTerminal is (true). Default: (true)

* supports placeholders

Additional placeholders

The following, and additional predefined placeholders, can also be used in arguments, if usePlaceholders is (true):

Name Description
cwd The working directory.
filesToDeploy The list of files, separated by fileSeparator setting.
operationFlag The value from deleteFlag, deployFlag or pullFlag setting.
outDirectory The value from outDirectory setting.
target The name of the target.

Argument scripts

A script must provide a public / exported getArguments() function:

exports.getArguments = function(args) {
    // return an array of arguments
    // directly or as promise
};

Input scripts

A script must provide a public / exported getInput() function:

exports.getInput = function(args) {
    // you can return the value for 'stdin'
    // as string, Buffer or NodeJS stream
    // directly or as promise
};
Clone this wiki locally